Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > Re: how to right the regular expression ?

Reply
Thread Tools

Re: how to right the regular expression ?

 
 
MRAB
Guest
Posts: n/a
 
      02-15-2013
On 2013-02-15 00:32, python wrote:
> the regex--- pat = r'([a-z].+?\s)(.+?)((\(.+\)))?$' ,do not work at all.
>

[snip]
Sorry, that should be:

pat1 = r'([a-z].+?\s)(.+?)((\(.+\)))?$'

Group 2 should've been lazy "(.+?)", and because of that it should've
forced matching the end of the line with "$".

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: How include a large array? Edward A. Falk C Programming 1 04-04-2013 08:07 PM
Re: how to right the regular expression ? MRAB Python 0 02-14-2013 03:43 PM
Match regular expression from LEFT to right fritz-bayer@web.de Perl Misc 13 08-27-2006 12:09 PM
how to match regular expression from right to left Liang Perl 2 08-27-2004 10:03 PM
Dynamically changing the regular expression of Regular Expression validator VSK ASP .Net 2 08-24-2003 02:47 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57