in reply to Re^2: Recognizing 3 and 4 digit number
in thread Recognizing 3 and 4 digit number

my $digits_4 = qr{ (?<![\/-\ \w]) \d{4} (?![\/-\ \w]) }xms;

untested...

Replies are listed 'Best First'.
Re^4: Recognizing 3 and 4 digit number
by htmanning (Friar) on Jan 02, 2017 at 03:05 UTC
    This one returns the following error:
    Invalid [] range "\\/-\\ " in regex; marked by <-- HERE in m/ (?<![\\/ +-\\ <-- HERE \\w]) \\d{4} (?![\\/-\\ \\w]) /
    I'm not really sure what is wrong.

      - should be at beginning or end of []