Page 1 of 1

Using RE to find and replace any ZIP code - but is inserting

Posted: Sat Oct 01, 2005 12:13 am
by HHaynes
Hi - I'm having a heckuva time getting a regular expression to actually replace a ZIP code in a file. So far, I've only managed to insert the desired ZIP, so now my file is invalid for my parser.


Starting value: ZipCode|06472

Batch replace: Search For:

Replace With:

Actual Output:

I'm not sure if there's something wrong with the structure of the regular expression or if it's a setting in AFR. Thanks in advance.

Posted: Sun Oct 02, 2005 4:00 pm
by Abacre

As far as I understood
you need to replace ZipCode|anynumber
by ZipCode|77625

Use the following:

Go to main menu - Action - Options - Batch replace
check ON "Modifier G".

In main window of the program:
Go to Batch replace, check on "Use regular expressions".

Search for:

Replace with:

That's all.

any number: \d
any numbers: \d+
| is reserved char, so we should escape it by using \|

Posted: Mon Oct 03, 2005 2:34 pm
by HHaynes
Excellent - turns out it was both config in AFR and my RE. Thanks!