in reply to Re^2: Regex failing when the line starts with "./"
in thread Regex failing when the line starts with "./"

Wouldn't (?:\.\\|\./) mean "full stop, then either backslash or dot, then forward slash"? ... Or does a | placed within grouping parentheses always match the entire first/second half of the grouping?

It is second case: [.\\] is one group of regex, [./] is the other.

To match per your first query, regex would be qr{[.] (?: \\ | . ) /}x (which I would rather write as qr{[.] [.\\] /}x but that is besides the point).

Replies are listed 'Best First'.
Re^4: Regex failing when the line starts with "./"
by Anonymous Monk on Feb 03, 2011 at 12:36 UTC

    Carp! Please change ...

    [.\\] is one group of regex, [./] is the other

    ... to ...

    .\\ is one group of regex, ./ is the other

      I give up (and wish I had remembered the password).