in reply to Can "delayed-regex assertions" be nested...
I noticed that even a simple regex in a (??{...}) block doesn't work:
#!/usr/bin/perl use strict; use warnings; $_ = "foo"; print "a" =~ m{.} ? "o\n" : "O\n"; if ( m/f (??{ "a" =~ m{.} ? 'o' : 'O' }) o/x){ print "matched\n" } __END__ o
In your position I'd precompute the regex instead of trying to stuff it all in one line.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Can "delayed-regex assertions" be nested...
by ddn123456 (Pilgrim) on Feb 21, 2008 at 11:29 UTC | |
by moritz (Cardinal) on Feb 21, 2008 at 12:03 UTC | |
by ddn123456 (Pilgrim) on Feb 21, 2008 at 12:39 UTC | |
by ddn123456 (Pilgrim) on Feb 21, 2008 at 13:41 UTC |