Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #57775
| From | Ben Finney <ben+python@benfinney.id.au> |
|---|---|
| Subject | Re: Parsing multiple lines from text file using regex |
| Date | 2013-10-28 10:34 +1100 |
| References | <mailman.1665.1382911575.18130.python-list@python.org> <op.w5mwa3iaa8ncjz@gnudebeest> <roy-A61323.18431627102013@news.panix.com> |
| Newsgroups | comp.lang.python |
| Message-ID | <mailman.1671.1382917205.18130.python-list@python.org> (permalink) |
Roy Smith <roy@panix.com> writes: > In article <op.w5mwa3iaa8ncjz@gnudebeest>, > "Rhodri James" <rhodri@wildebst.demon.co.uk> wrote: > > > I really, really wouldn't do this with a single regexp. You'll get a much > > easier to understand program if you implement a small state machine > > instead. > > And what is a regex if not a small state machine? Regex is not a state machine implemented by the original poster :-) Or, in other words, I interpret Rhodri as saying that the right way to do this is by implementing a *different* small state machine, which will address the task better than the small state machine of regex. -- \ “Pinky, are you pondering what I'm pondering?” “I think so, | `\ Brain, but three round meals a day wouldn't be as hard to | _o__) swallow.” —_Pinky and The Brain_ | Ben Finney
Back to comp.lang.python | Previous | Next — Previous in thread | Find similar | Unroll thread
Parsing multiple lines from text file using regex "Marc" <marc@marcd.org> - 2013-10-27 17:09 -0400
Re: Parsing multiple lines from text file using regex "Rhodri James" <rhodri@wildebst.demon.co.uk> - 2013-10-27 22:19 +0000
Re: Parsing multiple lines from text file using regex Roy Smith <roy@panix.com> - 2013-10-27 18:43 -0400
Re: Parsing multiple lines from text file using regex Ben Finney <ben+python@benfinney.id.au> - 2013-10-28 10:34 +1100
csiph-web