Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #64362

Re: regex multiple patterns in order

From Neil Cerutti <neilc@norwich.edu>
Subject Re: regex multiple patterns in order
Date 2014-01-20 16:04 +0000
Organization Norwich University
References <CAPV1RAAiD3qWqrAJYc4yb80CaHG4A9N4jz4aY_CsyJr_nAUx9Q@mail.gmail.com> <mailman.5748.1390216721.18130.python-list@python.org> <roy-C6EC2C.09525920012014@news.panix.com>
Newsgroups comp.lang.python
Message-ID <mailman.5750.1390233911.18130.python-list@python.org> (permalink)

Show all headers | View raw


On 2014-01-20, Roy Smith <roy@panix.com> wrote:
> In article
> <mailman.5748.1390216721.18130.python-list@python.org>, Ben
> Finney <ben+python@benfinney.id.au> wrote:
>> Be aware that regex is not the solution to all parsing
>> problems; for many parsing problems it is an attractive but
>> inappropriate tool. You may need to construct a more specific
>> parser for your needs. Even if it's possible with regex, the
>> resulting pattern may be so complex that it's better to write
>> it out more explicitly.
>
> Oh, posh.
>
> You are correct; regex is not the solution to all parsing
> problems, but it is a powerful tool which people should be
> encouraged to learn.  For some problems, it is indeed the
> correct tool, and this seems like one of them.  Discouraging
> people from learning about regexes is an educational
> anti-pattern which I see distressingly often on this newsgroup.

I use regular expressions regularly, for example, when editing
text with gvim. But when I want to use them in Python I have to
contend with the re module. I've never become comfortable with
it.

-- 
Neil Cerutti

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Re: regex multiple patterns in order Ben Finney <ben+python@benfinney.id.au> - 2014-01-20 22:18 +1100
  Re: regex multiple patterns in order Roy Smith <roy@panix.com> - 2014-01-20 09:52 -0500
    Re: regex multiple patterns in order Neil Cerutti <neilc@norwich.edu> - 2014-01-20 16:04 +0000
    Re: regex multiple patterns in order Mark Lawrence <breamoreboy@yahoo.co.uk> - 2014-01-20 16:16 +0000
    Re: regex multiple patterns in order Devin Jeanpierre <jeanpierreda@gmail.com> - 2014-01-20 08:40 -0800
      Re: regex multiple patterns in order Rustom Mody <rustompmody@gmail.com> - 2014-01-20 09:06 -0800
        Re: regex multiple patterns in order Mark Lawrence <breamoreboy@yahoo.co.uk> - 2014-01-20 17:30 +0000
    Re: regex multiple patterns in order Neil Cerutti <neilc@norwich.edu> - 2014-01-20 17:09 +0000
    Re: regex multiple patterns in order Mark Lawrence <breamoreboy@yahoo.co.uk> - 2014-01-20 17:33 +0000

csiph-web