[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Chicken-users] Regex fail?

From: John Cowan
Subject: Re: [Chicken-users] Regex fail?
Date: Fri, 30 Oct 2015 09:01:30 -0400
User-agent: Mutt/1.5.20 (2009-06-14)

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.

John Cowan        address@hidden
You know, you haven't stopped talking since I came here. You must
have been vaccinated with a phonograph needle.
        --Rufus T. Firefly

reply via email to

[Prev in Thread] Current Thread [Next in Thread]