[Israel.pm] Regexp

Peter Gordon peter at pg-consultants.com
Thu Jun 2 01:05:05 PDT 2005


Suppose I have the text "HarryMaryJaneHarryxMaryJane" and I want to find
the longest duplicate match.

If I use /(.+).*?(\1)/
it matches Harry, but the longest match is MaryJane. 

What is the best approach to this problem?


-- 
Peter Gordon
Phone: +972 544 438029
Email: peter at pg-consultants.com
Web: www.pg-consultants.com




More information about the Perl mailing list