Re: catastrophic regexp, help!

2008-06-11 Thread alfasub000
On Jun 11, 11:07 pm, cirfu <[EMAIL PROTECTED]> wrote: > On 11 Juni, 10:25, Chris <[EMAIL PROTECTED]> wrote: > > > > > On Jun 11, 6:20 am, cirfu <[EMAIL PROTECTED]> wrote: > > > > pat = re.compile("(\w* *)*") > > > this matches all sentences. > > > if fed the string "are you crazy? i am" it will ret

Re: catastrophic regexp, help!

2008-06-11 Thread cirfu
On 11 Juni, 10:25, Chris <[EMAIL PROTECTED]> wrote: > On Jun 11, 6:20 am, cirfu <[EMAIL PROTECTED]> wrote: > > > pat = re.compile("(\w* *)*") > > this matches all sentences. > > if fed the string "are you crazy? i am" it will return "are you > > crazy". > > > i want to find a in a big string a sent

Re: catastrophic regexp, help!

2008-06-11 Thread cirfu
On 11 Juni, 17:04, TheSaint <[EMAIL PROTECTED]> wrote: > On 12:20, mercoledì 11 giugno 2008 cirfu wrote: > > > patzln = re.compile("(\w* *)* zlatan ibrahimovic (\w* *)*") > > I think that I shouldn't put anything around the phrase you want to find. > > patzln = re.compile(r'.*(zlatan ibrahimovic){1

Re: catastrophic regexp, help!

2008-06-11 Thread Peter Pearson
On Tue, 10 Jun 2008 21:20:14 -0700 (PDT), cirfu <[EMAIL PROTECTED]> wrote: > pat = re.compile("(\w* *)*") > this matches all sentences. > if fed the string "are you crazy? i am" it will return "are you > crazy". > > i want to find a in a big string a sentence containing Zlatan > Ibrahimovic and som

Re: catastrophic regexp, help!

2008-06-11 Thread TheSaint
On 12:20, mercoledì 11 giugno 2008 cirfu wrote: > patzln = re.compile("(\w* *)* zlatan ibrahimovic (\w* *)*") I think that I shouldn't put anything around the phrase you want to find. patzln = re.compile(r'.*(zlatan ibrahimovic){1,1}.*') this should do it for you. Unless searching into a specia

Re: catastrophic regexp, help!

2008-06-11 Thread Chris
On Jun 11, 6:20 am, cirfu <[EMAIL PROTECTED]> wrote: > pat = re.compile("(\w* *)*") > this matches all sentences. > if fed the string "are you crazy? i am" it will return "are you > crazy". > > i want to find a in a big string a sentence containing Zlatan > Ibrahimovic and some other text. > ie ret

Re: catastrophic regexp, help!

2008-06-11 Thread Maric Michaud
Le Wednesday 11 June 2008 09:08:53 Maric Michaud, vous avez écrit : > "this is zlatan example.' > compare with 'this is zlatan example', 'z'=='.', false > compare with 'this is zlatan ', 'z'=='e', false > compare with 'this is zlatan', 'z'==' ', false > compare with 'this is ', "zlatan"=="zlatan",

Re: catastrophic regexp, help!

2008-06-11 Thread Maric Michaud
Le Wednesday 11 June 2008 06:20:14 cirfu, vous avez écrit : > pat = re.compile("(\w* *)*") > this matches all sentences. > if fed the string "are you crazy? i am" it will return "are you > crazy". > > i want to find a in a big string a sentence containing Zlatan > Ibrahimovic and some other text. >

catastrophic regexp, help!

2008-06-10 Thread cirfu
pat = re.compile("(\w* *)*") this matches all sentences. if fed the string "are you crazy? i am" it will return "are you crazy". i want to find a in a big string a sentence containing Zlatan Ibrahimovic and some other text. ie return the first sentence containing the name Zlatan Ibrahimovic. pat