Re: Need help with a regular expression

2007-12-19 Thread Sharun
Thanks Marek! -- http://mail.python.org/mailman/listinfo/python-list

Re: Need help with a regular expression

2007-12-19 Thread Paddy
On Dec 19, 12:08 pm, Sharun <[EMAIL PROTECTED]> wrote: > Python newbie here. I am not clear about how the matching is taking > place when I do the following > > >str5 = 'aaa bbb\r\n ccc ddd\r\n eee fff' > >re5=re.compile('aaa.*(ddd|fff)',re.S); > >re5.search(str5).group(0) > > 'aaa bbb\r\n ccc ddd\

Re: Need help with a regular expression

2007-12-19 Thread marek . rocki
On 19 Gru, 13:08, Sharun <[EMAIL PROTECTED]> wrote: > I am trying to find the substring starting with 'aaa', and ending with > ddd OR fff. If ddd is found shouldnt the search stop? Shouldn't > re5.search(str5).group(0) return 'aaa bbb\r\n ccc ddd' ? The documentation for the re module (http://docs

Need help with a regular expression

2007-12-19 Thread Sharun
Python newbie here. I am not clear about how the matching is taking place when I do the following >str5 = 'aaa bbb\r\n ccc ddd\r\n eee fff' >re5=re.compile('aaa.*(ddd|fff)',re.S); >re5.search(str5).group(0) 'aaa bbb\r\n ccc ddd\r\n eee fff' >re5.search(str5).group(1) 'fff' I am trying to find th