in reply to Regex boundary match
DB<21> $test = qq|Some test. This is a test-with a dash. We want to m +atch test here| DB<22> x $test =~ /\b(test)(?!-)\b/g 0 'test' 1 'test' DB<23> print pos($test),":$1\n" while $test =~ /\b(test)(?!-)\b/g 9:test 60:test
Cheers Rolf
(addicted to the Perl Programming Language :)
Wikisyntax for the Monastery
FootballPerl is like chess, only without the dice
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: Regex boundary match (updated demo code)
by ultranerds (Hermit) on Feb 08, 2020 at 14:08 UTC | |
by AnomalousMonk (Archbishop) on Feb 08, 2020 at 15:55 UTC |