|Subject:||Re: [Chicken-users] Regex fail?|
|Date:||Sun, 1 Nov 2015 22:58:15 +0900|
Peter Bex scripsit:
> Note the nonl, which the manual states is equivalent to ".", but of
> course nonl means "no newline".
Dot in regular expressions has *always* meant "match any character but a
newline". It doesn't come up that much in Unix commands, which typically
process their input line by line anyway. But if you look at the Posix
definition or the Perl one, you see that dot is indeed equivalent to "nonl".
Indeed, "nonl" exists in order to have an SRE equivalent for dot.
> Maybe Alex can give us some info about why this is the case? I think this
> may have something to do with the multi-line / single-line distinction
> (which, to be honest, I never really understood).
Multi-line and single-line mean totally different things: you can use one
of them or both or neither. Multi-line mode means that ^ and $ will match
the beginning and end of a line as well as the beginning and the end of
the string. In non-multi-line mode, they match only the beginning and
the end of the string. Single-line mode means that dot matches newline;
non-single-line mode means that it does not.
|[Prev in Thread]||Current Thread||[Next in Thread]|