From: Guido van Rossum Date: Wed, 14 May 1997 18:27:51 +0000 (+0000) Subject: Fix showstopping bug (^ wouldn't match after \n). Jeffrey Ollie. X-Git-Tag: v1.5a2~17 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=fc4f503762cddab450a2c30bbf5fee3039f92c2e;p=python Fix showstopping bug (^ wouldn't match after \n). Jeffrey Ollie. --- diff --git a/Modules/regexpr.c b/Modules/regexpr.c index 90bff874ab..87f747fc3e 100644 --- a/Modules/regexpr.c +++ b/Modules/regexpr.c @@ -1914,7 +1914,7 @@ int re_search(regexp_t bufp, } if (anchor == 1) { /* anchored to begline */ - if (pos > 0 && string[pos - 1]) + if (pos > 0 && (string[pos - 1] != '\n')) continue; } assert(pos >= 0 && pos <= size);