f 'us::' terms varies, and kent's solution works
well.
Daniel
On 9/16/07, Kent Johnson <[EMAIL PROTECTED]> wrote:
>
> 王超 wrote:
> > The number of iterms - (us::.*?) - varies.
> >
> > When I use re.findall with (us::*?), only several 'us::' ar
The number of iterms - (us::.*?) - varies.
When I use re.findall with (us::*?), only several 'us::' are extracted.
Daniel
On 9/16/07, Kent Johnson <[EMAIL PROTECTED]> wrote:
>
> 王超 wrote:
> > yes, but I mean if I have the line like this:
> >
> >
):
> ... print 'we have a match'
> ...
> we have a match
> >>>
>
> >>> line2 ='us::blah blah2 1001 blah3'
> >>> if TAG_pattern.search(line2):
> ... print 'we have a match'
> ... else:
> ... print
hi,
I want to match the regular expression from right to left, such as:
TAG_pattern = re.compile(r"(us::.*) .*(1002|1003).*$")
TAG_pattern.search(line)
Does the search method support this?
Thanks,
Daniel
___
Tutor maillist - Tutor@python.org
http://