inconsistency? Re: Boy do REs ever suck sometimes...

Carsten Gaebler clpy at snakefarm.org
Fri Oct 5 11:19:53 EDT 2001


Roman Suzi wrote:

> >>> re.match("^(123)($)", "123\n").group(1, 2)
> ('123', '')
> 
> If $ matches \n, then why doesn't it include it to the
> group?

$ doesn't match \n, it matches immediately before \n (according to
the docs).

cg.



More information about the Python-list mailing list