Perl RegEx Back References

Get help with installation and running here.

Moderators: DataMystic Support, Moderators

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

Perl RegEx Back References

Postby slouw » Wed Dec 18, 2013 5:47 pm

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: 2162
Joined: Mon Jun 30, 2003 12:32 pm
Location: Melbourne, Australia
Contact:

Re: Perl RegEx Back References

Postby DataMystic Support » Fri Dec 20, 2013 12:41 pm

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

Code: Select all

$1$$2$$3$


ie $1$ followed by $2$ etc
Regards,

Simon Carter, http://DataMystic.com/forums/index.php
http://PredictBGL.com - Insulin dose calculator for Type 1 diabetes
http://DownloadPipe.com - 250,000 free software downloads
http://DetachPipe.com - send huge email attachments

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

Re: Perl RegEx Back References

Postby slouw » Fri Dec 20, 2013 1:45 pm

Fantastic! Thank you. Works a treat. Should I have seen this in the notes/help somewhere? Thanks again

DFH
Posts: 654
Joined: Sun Dec 09, 2007 2:49 am
Location: UK

Re: Perl RegEx Back References

Postby DFH » Thu Dec 26, 2013 4:07 am

But why not use a CSV replace filter?

Simpler to understand & maintain.


Return to “TextPipe Tips and Tricks, Questions and Support”

Who is online

Users browsing this forum: Yahoo [Bot] and 2 guests