in reply to regex to match double letters but not triple or more
DB<83> $re= qr/(?:^|(.)(?!\1)) ([[:alpha:]]){2} (?!\2)/x DB<84> say join "\t", $_, $_ =~ $re for <{,x}AA{,A}{,y}> AA A AAy A AAA AAAy xAA x A xAAy x A xAAA xAAAy DB<85>
Just realized, in the end it's very similar to the last solution in Re: regex to match double letters but not triple or more.
But somehow it works for me...???
Cheers Rolf
(addicted to the Perl Programming Language :)
see Wikisyntax for the Monastery
|
|---|