diff options
author | Andrew M. Kuchling <amk@amk.ca> | 2004-08-31 12:07:43 (GMT) |
---|---|---|
committer | Andrew M. Kuchling <amk@amk.ca> | 2004-08-31 12:07:43 (GMT) |
commit | ab7782282643e7f0c5e752e1e3909f2b4dcdfc53 (patch) | |
tree | a6f84a786659633de09df664912dcc2cef94fa2e /Doc/whatsnew | |
parent | b07aae28c5d6dd87476cae66995df708856ffa0e (diff) | |
download | cpython-ab7782282643e7f0c5e752e1e3909f2b4dcdfc53.zip cpython-ab7782282643e7f0c5e752e1e3909f2b4dcdfc53.tar.gz cpython-ab7782282643e7f0c5e752e1e3909f2b4dcdfc53.tar.bz2 |
Describe non-recursive re
Diffstat (limited to 'Doc/whatsnew')
-rw-r--r-- | Doc/whatsnew/whatsnew24.tex | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/Doc/whatsnew/whatsnew24.tex b/Doc/whatsnew/whatsnew24.tex index 530a0b2..9f3855b 100644 --- a/Doc/whatsnew/whatsnew24.tex +++ b/Doc/whatsnew/whatsnew24.tex @@ -1184,18 +1184,27 @@ not it's a symbolic link. This differs from the existing \item The regular expression language accepted by the \module{re} module was extended with simple conditional expressions, written as - \code{(?(\var{group})\var{A}|\var{B})}. \var{group} is either a - numeric group ID or a group name defined with \code{(?P<group>...)} + \regexp{(?(\var{group})\var{A}|\var{B})}. \var{group} is either a + numeric group ID or a group name defined with \regexp{(?P<group>...)} earlier in the expression. If the specified group matched, the regular expression pattern \var{A} will be tested against the string; if the group didn't match, the pattern \var{B} will be used instead. +\item The \module{re} module is also no longer recursive, thanks +to a massive amount of work by Gustavo Niemeyer. In a recursive +regular expression engine, certain patterns result in a large amount +of C stack space being consumed, and it was possible to overflow the +stack. For example, if you matched a 30000-byte string of \samp{a} +characters against the expression \regexp{(a|b)+}, one stack frame was +consumed per character. Python 2.3 tried to check for stack overflow +and raise a \exception{RuntimeError} exception, but if you were +unlucky Python could dump core. Python 2.4's regular expression +engine can match this pattern without problems. + \item A new \function{socketpair()} function was added to the \module{socket} module, returning a pair of connected sockets. (Contributed by Dave Cole.) -% XXX sre is now non-recursive. - \item The \function{sys.exitfunc()} function has been deprecated. Code should be using the existing \module{atexit} module, which correctly handles calling multiple exit functions. Eventually |