Page 1 of 1

Simple replacement question

Posted: Fri Feb 16, 2007 4:06 am
by Lucrothe
Hello, I have what I think to be a simple replacement, but I'm new to the world of RE's so I'm having some troubles.

I need to change this:

Code: Select all

( 76, 100 );

(the two groups of numbers will be any 3 digit combination, so the numbers will need to be wild cards)

to this:

Code: Select all

( 76+LevelVal, 100+LevelVal );

(the numbers from above need to be same down here)

Any help would be great!

Thank you,


Posted: Fri Feb 16, 2007 7:14 am
by Abacre
Go to main menu - Action - Options - Batch Replace
check "Modifier G"

Go to Batch replace tab, check on "Use regular expressions".
Put into the grid, search for:
\( (\d{1,3}), (\d{1,3}) \);

Replace with:
( $1+LevelVal, $2+LevelVal );

That's all I verified it works perfectly.

\d means a digit
\d{1,3} means 1 to 3 digits.

Posted: Fri Feb 16, 2007 12:04 pm
by Lucrothe
Thank you very much for all of your help, and the wonderful explanation!