Page 1 of 1

Perl RegEx Back References

Posted: Wed Dec 18, 2013 5:47 pm
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

Re: Perl RegEx Back References

Posted: Fri Dec 20, 2013 12:41 pm
by DataMystic Support
\001\002\003 is wrong, needs to be

Code: Select all

$1$$2$$3$
ie $1$ followed by $2$ etc

Re: Perl RegEx Back References

Posted: Fri Dec 20, 2013 1:45 pm
by slouw
Fantastic! Thank you. Works a treat. Should I have seen this in the notes/help somewhere? Thanks again

Re: Perl RegEx Back References

Posted: Thu Dec 26, 2013 4:07 am
by dfhtextpipe
But why not use a CSV replace filter?

Simpler to understand & maintain.