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


Groups > comp.lang.python > #6451 > unrolled thread

Re: Why did Quora choose Python for its development?

Started byCarl Banks <pavlovevidence@gmail.com>
First post2011-05-27 22:32 -0700
Last post2011-05-28 08:37 -0400
Articles 2 — 2 participants

Back to article view | Back to comp.lang.python


Contents

  Re: Why did Quora choose Python for its development? Carl Banks <pavlovevidence@gmail.com> - 2011-05-27 22:32 -0700
    Re: Why did Quora choose Python for its development? Roy Smith <roy@panix.com> - 2011-05-28 08:37 -0400

#6451 — Re: Why did Quora choose Python for its development?

FromCarl Banks <pavlovevidence@gmail.com>
Date2011-05-27 22:32 -0700
SubjectRe: Why did Quora choose Python for its development?
Message-ID<fbd69b90-b709-48ed-a247-af943ddbccef@glegroupsg2000goo.googlegroups.com>
On Friday, May 27, 2011 6:47:21 AM UTC-7, Roy Smith wrote:
> In article <948l8n...@mid.individual.net>,
>  Gregory Ewing <greg....@canterbury.ac.nz> wrote:
> 
> > John Bokma wrote:
> > 
> > > A Perl programmer will call this line noise:
> > > 
> > > double_word_re = re.compile(r"\b(?P<word>\w+)\s+(?P=word)(?!\w)",
> > >                             re.IGNORECASE)
> 
> One of the truly awesome things about the Python re library is that it 
> lets you write complex regexes like this:
> 
> pattern = r"""\b                     # beginning of line
>               (?P<word>\w+)          # a word
>               \s+                    # some whitespace
>               (?P=word)(?!\w)        # the same word again
>            """
> double_word_re = re.compile(pattern,  re.I | re.X)

Perl has the X flag as well, in fact I'm pretty sure Perl originated it.  Just saying.


Carl Banks

[toc] | [next] | [standalone]


#6466

FromRoy Smith <roy@panix.com>
Date2011-05-28 08:37 -0400
Message-ID<roy-935A1D.08371028052011@news.panix.com>
In reply to#6451
In article 
<fbd69b90-b709-48ed-a247-af943ddbccef@glegroupsg2000goo.googlegroups.com
>,
 Carl Banks <pavlovevidence@gmail.com> wrote:

> On Friday, May 27, 2011 6:47:21 AM UTC-7, Roy Smith wrote:

> > One of the truly awesome things about the Python re library is that it 
> > lets you write complex regexes like this:
> > 
> > pattern = r"""\b                     # beginning of line
> >               (?P<word>\w+)          # a word
> >               \s+                    # some whitespace
> >               (?P=word)(?!\w)        # the same word again
> >            """
> 
> Perl has the X flag as well, in fact I'm pretty sure Perl originated it.  
> Just saying.

Heh.  Didn't know that.  I wish people would use it more.

[toc] | [prev] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web