I need to transform some hundreds of thousands of lines of program code. A solution to the following problem would be a big start:
This
procedure showmessage(mess as string,mheight as long)
if vartype(.....
needs to become this
function showmessage(mess as stringt,mheight as long)
{
if vartype(....
Where everything varies except "procedure" in the search block, and "function" and brace in the replace block.
Gleason
Use regular expressions in replace?
Moderators: DataMystic Support, Moderators, DataMystic Support, Moderators, DataMystic Support, Moderators
- DataMystic Support
- Site Admin
- Posts: 2227
- Joined: Mon Jun 30, 2003 12:32 pm
- Location: Melbourne, Australia
- Contact:
Re: Use regular expressions in replace?
Find perl pattern:
replace with:
Code: Select all
procedure (\w+)\((\w+) as string,(\w+) as long\)
if vartype\(
Code: Select all
function $1($2 as string,$3 as long)
{
if vartype(....
Re: Use regular expressions in replace?
Close enough that I can make it work. Thanks.DataMystic Support wrote:Find perl pattern:replace with:Code: Select all
procedure (\w+)\((\w+) as string,(\w+) as long\) if vartype\(
Code: Select all
function $1($2 as string,$3 as long) { if vartype(....