in reply to /s does not match end-of-line
Hello glendeni,
Yes, /\s/ does match a newline character:
13:41 >perl -wE "say qq[Matched >$1<] if qq[abc2345] =~ /([0-9]+)\s/; 13:41 >perl -wE "say qq[Matched >$1<] if qq[abc2345 ] =~ /([0-9]+)\s/; Matched >2345< 13:42 >perl -wE "say qq[Matched >$1<] if qq[abc2345\n] =~ /([0-9]+)\s/ +; Matched >2345< 13:42 >perl -v This is perl 5, version 26, subversion 0 (v5.26.0) built for MSWin32-x +64-multi-thread-ld
For the meaning of \s in a regex, see “Whitespace” in perlrecharclass#Backslash-sequences.
Hope that helps,
| Athanasius <°(((>< contra mundum | Iustus alius egestas vitae, eros Piratica, |
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: \s does not match end-of-line
by glendeni (Sexton) on Feb 06, 2018 at 04:07 UTC | |
by AnomalousMonk (Archbishop) on Feb 06, 2018 at 04:50 UTC | |
by glendeni (Sexton) on Feb 06, 2018 at 05:14 UTC | |
by AnomalousMonk (Archbishop) on Feb 06, 2018 at 06:08 UTC | |
by hippo (Archbishop) on Feb 06, 2018 at 10:28 UTC |