Code Comments
Programming Forum and web based access to our favorite programming groups.Hi all, I have a question regarding Regular Expression and backreference. Is it possible to use backreferences within the same reg ex? e.g. m/SomeText([0-9]+).*?SomeOtherText($1)/gs $1 should be the number of the match behind "SomeText" BR Thorsten
Post Follow-up to this messageThorsten Walenzyk wrote: > > I have a question regarding Regular Expression and backreference. > > Is it possible to use backreferences within the same reg ex? > e.g. > m/SomeText([0-9]+).*?SomeOtherText($1)/gs > > $1 should be the number of the match behind "SomeText" Yes it is possible, like this: /SomeText(\d+).*?SomeOtherText\1/gs John -- use Perl; program fulfillment
Post Follow-up to this message
Show a Printable Version
Email This Page to Someone!
Receive updates to this thread
Powered by vBulletin
Copyright 2000-2006 Jelsoft Enterprises Limited.