Perl RegEx Back References

Get help with installation and running here.

Moderators: DataMystic Support, Moderators, DataMystic Support, Moderators, DataMystic Support, Moderators

Post Reply
slouw
Posts: 8
Joined: Wed Dec 18, 2013 4:48 pm

Perl RegEx Back References

Post by slouw »

Please help with a Find and Replace using Perl Regex and back references.
I get the unexpected output as shown in the 2nd screenshot.
I am expecting/wating to get rid of everything after the first 3 CSV entries

Image

Image

Many thanks for nay reply
User avatar
DataMystic Support
Site Admin
Posts: 2227
Joined: Mon Jun 30, 2003 12:32 pm
Location: Melbourne, Australia
Contact:

Re: Perl RegEx Back References

Post by DataMystic Support »

\001\002\003 is wrong, needs to be

Code: Select all

$1$$2$$3$
ie $1$ followed by $2$ etc
slouw
Posts: 8
Joined: Wed Dec 18, 2013 4:48 pm

Re: Perl RegEx Back References

Post by slouw »

Fantastic! Thank you. Works a treat. Should I have seen this in the notes/help somewhere? Thanks again
dfhtextpipe
Posts: 986
Joined: Sun Dec 09, 2007 2:49 am
Location: UK

Re: Perl RegEx Back References

Post by dfhtextpipe »

But why not use a CSV replace filter?

Simpler to understand & maintain.
David
Post Reply