Simple replacement question

General discussions about Advanced Find and Replace
Post Reply
Lucrothe
Posts: 2
Joined: Fri Feb 16, 2007 3:52 am

Simple replacement question

Post 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,

-Lucrothe

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

Post 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.

Explanations:
\d means a digit
\d{1,3} means 1 to 3 digits.
Kind regards,
Abacre Limited
http://www.abacre.com
support@abacre.com

Lucrothe
Posts: 2
Joined: Fri Feb 16, 2007 3:52 am

Post by Lucrothe »

Thank you very much for all of your help, and the wonderful explanation!

Post Reply