That'll teach me to blab about features I don't know without testing them first. Yes, positive lookahead would definitely be possible. You'd have to flip your test, though.
$x = 'aba';
print $x =~ /(.)(?=\1)/
? "double!\n"
: "not double!\n";
$x = 'abba';
print $x =~ /(.)(?=\1)/
? "double!\n"
: "not double!\n";
----
not double!
double!
------ We are the carpenters and bricklayers of the Information Age. The idea is a little like C++ templates, except not quite so brain-meltingly complicated. -- TheDamian, Exegesis 6 Please remember that I'm crufty and crochety. All opinions are purely mine and all code is untested, unless otherwise specified.
| [reply] [d/l] |