On Fri, Jan 25, 2013 at 09:23:54AM -0800, Philip Hazel wrote: > My understanding of how (*THEN) works is that the test below should > match. The perlre page says "...this verb always matches, and when > backtracked into on failure, it causes the regex engine to try the next > alternation in the innermost enclosing group (capturing or otherwise) > that has alternations." Unless I am going mad, the examples below (one a > normal group, the other an assertion) fulfil the condition. > > $ perl -e 'print (("ac" =~ /^(?=ab|ac)/)? "yes\n":"no\n")' > yes > $ perl -e 'print (("ac" =~ /^(?=a(*THEN)b|ac)/)? "yes\n":"no\n")' > no > > $ perl -e 'print (("ac" =~ /^(ab|ac)/)? "yes\n":"no\n")' > yes > $ perl -e 'print (("ac" =~ /^(a(*THEN)b|ac)/)? "yes\n":"no\n")' > no These work in 5.10.1, but not in 5.14.1. These are the only tests involving (*THEN) that expect a successful match, from t/re/pat_advanced.t: { #Mindnumbingly simple test of (*THEN) for ("ABC","BAX") { ok /A (*THEN) X | B (*THEN) C/x, "Simple (*THEN) test"; } } The key difference seems to be that in your tests, the two alternations begin with the same character. RonaldThread Previous | Thread Next