Re: [Tutor] RE Silliness

2009-01-05 Thread bob gailer
Omer wrote: Bob, I tried your way. >>> import re >>> urlMask = r"http://[\w\Q./\?=\R]+()?" >>> text=u"Not working examplehttp://this.is.a/url?header=nullAnd another linehttp://and.another.url"; >>> re.findall(urlMask,text) [u'', u''] Oops I failed to notice you were using findall. Kent expl

Re: [Tutor] RE Silliness

2009-01-05 Thread Kent Johnson
On Mon, Jan 5, 2009 at 11:16 AM, Omer wrote: > Bob, I tried your way. > import re urlMask = r"http://[\w\Q./\?=\R]+()?" text=u"Not working examplehttp://this.is.a/url?header=nullAnd another linehttp://and.another.url"; re.findall(urlMask,text) > [u'', u''] > > spir, I did

Re: [Tutor] RE Silliness

2009-01-05 Thread Omer
Bob, I tried your way. >>> import re >>> urlMask = r"http://[\w\Q./\?=\R]+()?" >>> text=u"Not working examplehttp://this.is.a/url?header=nullAnd another linehttp://and.another.url"; >>> re.findall(urlMask,text) [u'', u''] spir, I did understand it. What I'm not understanding is why isn't this wor

Re: [Tutor] RE Silliness

2009-01-04 Thread spir
On Sun, 04 Jan 2009 14:09:53 -0500 bob gailer wrote: > Omer wrote: > > I'm sorry, burrowed into the reference until my eyes bled. > > > > What I want is to have a regular expression with an optional ending of > > "" > > > > (For those interested, > > urlMask = r"http://[\w\Q./\?=\R]+"; > > is th

Re: [Tutor] RE Silliness

2009-01-04 Thread bob gailer
Omer wrote: I'm sorry, burrowed into the reference until my eyes bled. What I want is to have a regular expression with an optional ending of "" (For those interested, urlMask = r"http://[\w\Q./\?=\R]+"; is ther version w/o the optional ending.) I can't seem to make a string optional- only

[Tutor] RE Silliness

2009-01-04 Thread Omer
I'm sorry, burrowed into the reference until my eyes bled. What I want is to have a regular expression with an optional ending of "" (For those interested, urlMask = r"http://[\w\Q./\?=\R]+"; is ther version w/o the optional ending.) I can't seem to make a string optional- only a single charact