http://www.perlmonks.org?node_id=1032158


in reply to help with regex

Your "Regex 1" matches because the space that precedes the backslash is neither a newline character nor a backslash. The only difference between Regex 1 and Regex 2 is that the latter will only match if the backslash is preceded by space, whereas in Regex 1, the backslash can be preceded by anything other than a newline or another backslash.

Replies are listed 'Best First'.
Re^2: help with regex
by rnaeye (Friar) on May 06, 2013 at 00:23 UTC

    Thanks for the help. It's simple after you explained it.