Skip to content

Commit

Permalink
Better explaination of a \n meaning in regular expression.
Browse files Browse the repository at this point in the history
Partially due to the issue #1790.
I guess the original author's intent was to specify that \r\n can be
either mangled thru a regex or an IO operation.
  • Loading branch information
fluca1978 committed Feb 26, 2018
1 parent 4276eb2 commit ae94bbe
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions doc/Language/regexes.pod6
Expand Up @@ -144,9 +144,12 @@ can be matched with C<\v>, and C<\s> matches any kind of whitespace.
=item X<C<\n> and C<\N>|regex,\n;regex,\N>
C<\n> matches a single, logical newline character. C<\n> is supposed to also
match a Windows CR LF codepoint pair; though it's unclear whether the magic
happens at the time that external data is read, or at regex match time.
C<\n> matches a single, logical newline character.
What is considered as a I<single newline character> is defined via the compile time
variable L<$?NL>, and the L<newline pragma|/language/pragmas>.
Therefore C<\n> is supposed to be able to either match a Unix-like newline "\n"
or a Microsoft Windows style one "\r\n".
C<\N> matches a single character that's not a logical newline.
=item X<C<\s> and C<\S>|regex,\s;regex,\S>
Expand Down

0 comments on commit ae94bbe

Please sign in to comment.