in reply to Re: Regex \. help
in thread Regex \. help
Loops: You read the OP a bit more slowly and carefully, and came closer, I think, to answering codz67's question as a result. But the (\.\d+)? is redundant for the given inputs and outputs if the negative look-ahead is used. (Had it been needed, it would probably have been better as a (?:...) non-capturing group.)
c:\@Work\Perl>perl -wMstrict -le "my @t = qw( regex regex.1 regex.12 regex.1a regex.a regex.abc regex.a +1 oregex.2 ); for (@t) { printf qq{'$_'}; printf ' matches!' if /^regex(?!\.[^\d])/; print ''; } " 'regex' matches! 'regex.1' matches! 'regex.12' matches! 'regex.1a' matches! 'regex.a' 'regex.abc' 'regex.a1' 'oregex.2'
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^3: Regex \. help
by Loops (Curate) on Nov 22, 2014 at 01:30 UTC | |
by codz67 (Initiate) on Nov 24, 2014 at 19:59 UTC |
In Section
Seekers of Perl Wisdom