This is the mail archive of the guile@cygnus.com mailing list for the guile project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: expect module


Mikael Djurfeldt wrote:
> 
> Maciej Stachowiak <mstachow@alum.mit.edu> writes:
> 
> > I think it is more natural generally for `$' to match end-of-string,
> > as there are other ways to match newlines, and it is useful to match
> > end-of-string on strings that contain newlines.
> 
> I thought `$' had a very well defined meaning in regular expressions:
> matching the empty string at the end of a line.  It seems that giving
> it a new interpretation could confuse people.

`$' only appears to have this behavior, according to the regcomp
documentation, when the REG_NEWLINE flag is passed:

: `REG_NEWLINE'
:      Treat a newline in STRING as dividing STRING into multiple lines,
:      so that `$' can match before the newline and `^' can match after.
:      Also, don't permit `.' to match a newline, and don't permit
:      `[^...]' to match a newline.
: 
:      Otherwise, newline acts like any other ordinary character.


 - Maciej Stachowiak