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


Groups > comp.lang.python > #38899

Re: how to right the regular expression ?

Date 2013-02-15 01:26 +0000
From MRAB <python@mrabarnett.plus.com>
Subject Re: how to right the regular expression ?
References <227f6014.405c.13cd90da3d4.Coremail.mailtomanage@163.com> <511D062E.4080101@mrabarnett.plus.com> <4cf5d748.3ec.13cdb440835.Coremail.mailtomanage@163.com>
Newsgroups comp.lang.python
Message-ID <mailman.1793.1360891607.2939.python-list@python.org> (permalink)

Show all headers | View raw


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 "$".

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


Thread

Re: how to right the regular expression ? MRAB <python@mrabarnett.plus.com> - 2013-02-15 01:26 +0000

csiph-web