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


>>>>> "Maciej" == Maciej Stachowiak <mstachow@alum.mit.edu> writes:

>> Second, I don't understand the usage of `$' in regular expressions
>> here.  Or, rather, I think I understand it, but I don't like it.
>> The manual implies that $ will match newlines.  In reality it
>> matches the end of any string -- rendering it useless for my
>> purposes.

Maciej> What's wrong with putting `\n' in the regexp if you want to
Maciej> match newlines?

Nothing, really.  That's what I did.

Maciej> I think it is more natural generally for `$' to match
Maciej> end-of-string, as there are other ways to match newlines, and
Maciej> it is useful to match end-of-string on strings that contain
Maciej> newlines.

But does `$' really add any meaning to a regular expression as used by
the `expect' module, given its character-by-character nature?  Maybe
I'm fuzzy today, but I can't come up with a case where "RX" and "RX$"
have different meanings to expect.

Tom