in reply to Re^2: Nonrepeating characters in an RE (updated)
in thread Nonrepeating characters in an RE

I think a hash approach is likely to be faster.

If the regex approach is taken, a simpler regex would seem to be
    qr{ ([\Q$template\E]) .*? \1 }xms
where $template is the template string. Any $string that matches against this regex has a repeated character of the template. Repeated characters in the string that are not in the template are ignored (I assume this is what BernieC wants). If there are repeated characters in the template, the repeats are effectively ignored. However, this qr// will not handle an empty-string template.


Give a man a fish:  <%-{-{-{-<