check if regeular expression has results

2007-08-09 Thread shahargs
Hi, I'm looking for the best way to check if regular expression return true (it's mean - there is a match). for example, i want "if" that check if this regular expression: .*born.*to.* has a match. What's the way to do that simply? Thanks a lot, Shahar. -- http://mail.python.org/mailman/listinf

Re: get wikipedia source failed (urrlib2)

2007-08-07 Thread shahargs
On 7 , 11:54, [EMAIL PROTECTED] wrote: > Hi, > I'm trying to get wikipedia page source with urllib2: > usock = urllib2.urlopen("http://en.wikipedia.org/wiki/ > Albert_Einstein") > data = usock.read(); > usock.close(); > return data > I got exception because HTTP 403 error. why

get wikipedia source failed (urrlib2)

2007-08-07 Thread shahargs
Hi, I'm trying to get wikipedia page source with urllib2: usock = urllib2.urlopen("http://en.wikipedia.org/wiki/ Albert_Einstein") data = usock.read(); usock.close(); return data I got exception because HTTP 403 error. why? with my browser i can't access it without any problem? Tha

Re: Regular Expression Groups - loop

2007-08-07 Thread shahargs
Thank You, Marc and Peter. now, it's working. Shahar. -- http://mail.python.org/mailman/listinfo/python-list

Regular Expression Groups - loop

2007-08-07 Thread shahargs
Hi, I'm trying to write application which parse one page to sentences and then, check every group for few things. The code: rawstr = r"""([^.?!]+[.?!])""" regex=re.compile(rawstr) matchs=regex.search(document) document, is the text i parsing. I cheke