Page 1 of 1

How to write a Regular expression for the following:

Posted: Mon Jan 31, 2005 5:32 pm
by pelletic
locate a string like

Input:

Screen MAS001.PROG ACTION FIND

and replace it with $PROG\MAS001

Output
Screen $PROG\MAS001 ACTION FIND

The part that changes is MAS001

Posted: Mon Jan 31, 2005 5:32 pm
by Abacre
Hi,

I tested and the following works:

Search for:
Screen (.*)\.PROG ACTION FIND

Replace with:
Screen $PROG\\$1 ACTION FIND

I hope you have got an idea: you should use variables $1 and chars escaping.

Read again:
http://www.abacre.com/afr/manual/regexpsyntax.htm