use strict; use warnings; my @strings = qw( /help/one/one/one/something_here /buy/cash/buy/water/water/water/nothing_here ); for (@strings) { if (m{\b(\w+)/\1\b}) { print "Dup is '$1'\n"; } }
In reply to Re: Regex expression to match...
by wind
in thread Regex expression to match...
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |