Execute a Markov algorithm: Difference between revisions

m
→‎{{header|Python}}: Undid revision 70161 (that was a "series out of control").
(→‎{{header|Python}}: Simplified control flow in 'replace'.)
m (→‎{{header|Python}}: Undid revision 70161 (that was a "series out of control").)
Line 281:
 
=={{header|Python}}==
The example uses a regexp to parse the syntax of the grammar. This regexp is multi-line, and verbose and uses named groups to aid in understanding the regexp and to allow more meaningful group names to be used when extracting the replacement data from the grammars in function <code>extractreplacements</code>.
 
<lang python>import re
845

edits