How to write a Regular expression for the following:

General discussions about Advanced Find and Replace
Post Reply
pelletic
Posts: 4
Joined: Mon Jan 31, 2005 5:32 pm

How to write a Regular expression for the following:

Post by pelletic » Mon Jan 31, 2005 5:32 pm

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
Charles

Abacre
Site Admin
Posts: 1201
Joined: Mon Jan 31, 2005 5:32 pm
Contact:

Post by Abacre » Mon Jan 31, 2005 5:32 pm

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

Post Reply

Who is online

Users browsing this forum: No registered users and 3 guests