Commit 9479c958 authored by Fred Drake's avatar Fred Drake

Remove extra indenatation from sample interpreter session.

Remove whitespace from the middle of an inline RE example; it was OK for
the typeset formats, but LaTeX2HTML is more touchy about this.
parent dfd0b296
...@@ -857,17 +857,17 @@ of backtracking, you may encounter a RuntimeError exception with the message ...@@ -857,17 +857,17 @@ of backtracking, you may encounter a RuntimeError exception with the message
\code{maximum recursion limit exceeded}. For example, \code{maximum recursion limit exceeded}. For example,
\begin{verbatim} \begin{verbatim}
>>> s = "<" + "that's a very big string!"*1000 + ">" >>> s = "<" + "that's a very big string!"*1000 + ">"
>>> re.match('<.*?>', s) >>> re.match('<.*?>', s)
Traceback (most recent call last): Traceback (most recent call last):
File "<stdin>", line 1, in ? File "<stdin>", line 1, in ?
File "/usr/local/lib/python2.3/sre.py", line 132, in match File "/usr/local/lib/python2.3/sre.py", line 132, in match
return _compile(pattern, flags).match(string) return _compile(pattern, flags).match(string)
RuntimeError: maximum recursion limit exceeded RuntimeError: maximum recursion limit exceeded
\end{verbatim} \end{verbatim}
You can often restructure your regular expression to avoid backtracking. You can often restructure your regular expression to avoid backtracking.
The above regular expression can be recast as \regexp{\textless The above regular expression can be recast as
[\textasciicircum \textgreater]*\textgreater}. As a further \regexp{\textless[\textasciicircum \textgreater]*\textgreater}. As a
benefit, such regular expressions will run faster than their backtracking further benefit, such regular expressions will run faster than their
equivalents. backtracking equivalents.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment