in reply to Re^2: help with lazy matching
in thread help with lazy matching

You need to escape the forward-slash only if this character is used as the regex delimiter character.

c:\@Work\Perl\monks>perl -wMstrict -le "$_ = '/foo/bar/baz/bat'; print qq{'$1'} if /([^/]+)$/; " Unmatched [ in regex; marked by <-- HERE in m/([ <-- HERE ^/ at ... c:\@Work\Perl\monks>perl -wMstrict -le "$_ = '/foo/bar/baz/bat'; print qq{'$1'} if m{([^/]+)$}; " 'bat'


Give a man a fish:  <%-(-(-(-<