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

General discussions about Advanced Find and Replace
Post Reply
HHaynes
Posts: 2
Joined: Sat Oct 01, 2005 12:07 am

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

Post by HHaynes » Sat Oct 01, 2005 12:13 am

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.

Example:

Starting value: ZipCode|06472

Batch replace: Search For:
ZipCode|/d

Replace With:
ZipCode|77625

Actual Output:
ZipCode|77625|06472

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.

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

Post by Abacre » Sun Oct 02, 2005 4:00 pm

Hi,

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

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:
ZipCode\|\d+

Replace with:
ZipCode|77625

That's all.

Explanations:
any number: \d
any numbers: \d+
| is reserved char, so we should escape it by using \|
Kind regards,
Abacre Limited
http://www.abacre.com
support@abacre.com

HHaynes
Posts: 2
Joined: Sat Oct 01, 2005 12:07 am

Post by HHaynes » Mon Oct 03, 2005 2:34 pm

Excellent - turns out it was both config in AFR and my RE. Thanks!

Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests