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


Groups > comp.lang.python > #19448

Re: PyWart: Python regular expression syntax is not intuitive.

References <30949a2a-bfd4-4d22-a56b-22b1c6cdf1e8@m11g2000yqe.googlegroups.com> <mailman.5090.1327522663.27778.python-list@python.org> <e8a96135-3444-4484-97f0-3ae196f82f5e@p21g2000yqm.googlegroups.com>
From Ian Kelly <ian.g.kelly@gmail.com>
Date 2012-01-25 16:36 -0700
Subject Re: PyWart: Python regular expression syntax is not intuitive.
Newsgroups comp.lang.python
Message-ID <mailman.5101.1327534637.27778.python-list@python.org> (permalink)

Show all headers | View raw


On Wed, Jan 25, 2012 at 2:19 PM, Rick Johnson
<rantingrickjohnson@gmail.com> wrote:
> I disagree here.
> Whist some people may be "die-hard" fans of the un-intuitive perl
> regex syntax, i believe many, if not exponentially MORE people would
> like to have a better alternative. Do i want to remove the current
> "well established" re module? No. But i would like to create a new
> regex module that is more pythonic. A regex module that we can be
> proud of. And just maybe, a regex module that "sets the bar" for all
> other regular expressions.

Compact regex notations are inherently unpythonic.  While your
reimplementation may be more intuitive to you, I don't think that it's
more pythonic at all.

> Window dressing is important Ian, if not, then shop owners would not
> continue to show displays in their shop windows. What does window
> dressing do exactly? It attracts the masses, and without the masses
> all merchants will eventually go out of buisness. Note: my argument
> HAS NOTHING to do with the number of folks programming python (or any
> language). The argument is focused on module sustainability in a
> community. Modules that are morbidly DIFFICULT to learn do not last.

Well, FWIW, I think that the current re module was easier for me to
learn than your version would have been, mainly because the re module
matches the syntax that I was already familiar with well before I
started using Python.  If you think you can do better, though, I
encourage you to actually write your regex module and put it up on
PyPI.

> I know about PyParsing but i believe we have room for PyParsing and a
> more Pythonic take on Perl style regular expressions. I don't see why
> we could not keep all three. Let the people decide what is best for
> them.

PyParsing produces recursive descent parsers.  It's an alternative to
regular expressions for a different class of parsing problems, not a
replacement, and so it's not particularly germane to this discussion.

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


Thread

PyWart: Python regular expression syntax is not intuitive. Rick Johnson <rantingrickjohnson@gmail.com> - 2012-01-25 09:16 -0800
  Re: PyWart: Python regular expression syntax is not intuitive. Rick Johnson <rantingrickjohnson@gmail.com> - 2012-01-25 09:33 -0800
  Re: PyWart: Python regular expression syntax is not intuitive. Duncan Booth <duncan.booth@invalid.invalid> - 2012-01-25 19:32 +0000
    Re: PyWart: Python regular expression syntax is not intuitive. Devin Jeanpierre <jeanpierreda@gmail.com> - 2012-01-25 18:19 -0500
  Re: PyWart: Python regular expression syntax is not intuitive. Ian Kelly <ian.g.kelly@gmail.com> - 2012-01-25 13:17 -0700
    Re: PyWart: Python regular expression syntax is not intuitive. Rick Johnson <rantingrickjohnson@gmail.com> - 2012-01-25 13:19 -0800
      Re: PyWart: Python regular expression syntax is not intuitive. Duncan Booth <duncan.booth@invalid.invalid> - 2012-01-25 21:41 +0000
        Re: PyWart: Python regular expression syntax is not intuitive. Rick Johnson <rantingrickjohnson@gmail.com> - 2012-01-25 14:26 -0800
      Re: PyWart: Python regular expression syntax is not intuitive. Ian Kelly <ian.g.kelly@gmail.com> - 2012-01-25 16:36 -0700
        Re: PyWart: Python regular expression syntax is not intuitive. Rick Johnson <rantingrickjohnson@gmail.com> - 2012-01-25 16:14 -0800
          Re: PyWart: Python regular expression syntax is not intuitive. Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2012-01-26 01:58 +0000
          Re: PyWart: Python regular expression syntax is not intuitive. Devin Jeanpierre <jeanpierreda@gmail.com> - 2012-01-25 21:24 -0500
            Re: PyWart: Python regular expression syntax is not intuitive. Rick Johnson <rantingrickjohnson@gmail.com> - 2012-01-25 20:21 -0800
          Re: PyWart: Python regular expression syntax is not intuitive. Evan Driscoll <edriscoll@wisc.edu> - 2012-01-25 23:38 -0600
    Re: PyWart: Python regular expression syntax is not intuitive. Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2012-01-26 05:28 +0000
  Re: PyWart: Python regular expression syntax is not intuitive. Terry Reedy <tjreedy@udel.edu> - 2012-01-25 15:33 -0500
  Re: PyWart: Python regular expression syntax is not intuitive. Devin Jeanpierre <jeanpierreda@gmail.com> - 2012-01-25 18:28 -0500
    Re: PyWart: Python regular expression syntax is not intuitive. Rick Johnson <rantingrickjohnson@gmail.com> - 2012-01-25 15:44 -0800
      Re: PyWart: Python regular expression syntax is not intuitive. Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2012-01-26 05:28 +0000
  Re: PyWart: Python regular expression syntax is not intuitive. Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2012-01-26 01:54 +0000
    Re: PyWart: Python regular expression syntax is not intuitive. Michael Torrie <torriem@gmail.com> - 2012-01-25 19:05 -0700

csiph-web