我不能完全开始工作的部分是有条件的,因为它总是失败:
use Test::More tests => 2;
my $regex = qr/(\d+),(\d+)
(?(?{\g1<\g2})(*FAIL))
/x ;
like( "(23,36)", $regex, 'should match' );
unlike( "(36,23)", $regex, 'should not match' );
Run Code Online (Sandbox Code Playgroud)
not ok 1 - should match
# Failed test 'should match'
# at - line 7.
# '(23,36)'
# doesn't match '(?^x:(\d+),(\d+)
# (?(?{\g1<\g2})(*FAIL))
# )'
ok 2 - should not match
# Looks like you failed 1 test of 2.
Run Code Online (Sandbox Code Playgroud)