in reply to match character in a set, then match one of the other ones

Updated per moritz correction below.

So:

print $1 while 'hello' =~ m[(([a-z])(?!\2)[a-z])]g;; he lo

Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.

Replies are listed 'Best First'.
Re^2: match character in a set, them match one of the other ones
by moritz (Cardinal) on Aug 18, 2011 at 14:59 UTC
    That dot should probably be replaced by [a-z], if I understood the original question correctly.

      Indeed. Corrected above.