Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
Looking at perlre, why doesn't [\.|\s] below match 'number followed by period OR space character?
my( $item_num, $event, $sep, $day )= $entry =~ m{^ (\d+) [\.|\s] \s+ ( +.*?) \s+(-|\N{EN DASH}|\N{EM DASH})\s+ (.*?) $}x; example entries 123 Festival - Sunday # doesn't work 456. Pool Party - Tuesday # works
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Regex, match one or other character class
by choroba (Cardinal) on Apr 25, 2023 at 16:17 UTC | |
|
Re: Regex, match one or other character class
by hippo (Archbishop) on Apr 25, 2023 at 16:20 UTC | |
by LanX (Saint) on Apr 25, 2023 at 16:43 UTC | |
by hippo (Archbishop) on Apr 26, 2023 at 09:59 UTC | |
by LanX (Saint) on Apr 26, 2023 at 10:23 UTC |