Re: [Tutor] how to match regular expression from right to left

2007-09-16 Thread
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

Re: [Tutor] how to match regular expression from right to left

2007-09-16 Thread
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: > > > >

Re: [Tutor] how to match regular expression from right to left

2007-09-16 Thread
): > ... 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

[Tutor] how to match regular expression from right to left

2007-09-16 Thread
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://