Re: Hopefully simple regular expression question

2005-06-14 Thread [EMAIL PROTECTED]
Thank you! I had totally forgot about that. It works. -- http://mail.python.org/mailman/listinfo/python-list

Re: Hopefully simple regular expression question

2005-06-14 Thread TZOTZIOY
On 14 Jun 2005 04:01:58 -0700, rumours say that "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> might have written: >I want to match a word against a string such that 'peter' is found in >"peter bengtsson" or " hey peter," or but in "thepeter bengtsson" or >"hey peterbe," because the word has to stand on

Re: Hopefully simple regular expression question

2005-06-14 Thread Kalle Anke
On Tue, 14 Jun 2005 13:01:58 +0200, [EMAIL PROTECTED] wrote (in article <[EMAIL PROTECTED]>): > How do I modify my regular expression to match on expressions as well > as just single words?? import re def createStandaloneWordRegex(word): """ return a regular expression that can find 'peter'

Re: Hopefully simple regular expression question

2005-06-14 Thread John Machin
[EMAIL PROTECTED] wrote: > I want to match a word against a string such that 'peter' is found in > "peter bengtsson" or " hey peter," or but in "thepeter bengtsson" or > "hey peterbe," because the word has to stand on its own. The following > code works for a single word: > > def createStandaloneW

Hopefully simple regular expression question

2005-06-14 Thread [EMAIL PROTECTED]
I want to match a word against a string such that 'peter' is found in "peter bengtsson" or " hey peter," or but in "thepeter bengtsson" or "hey peterbe," because the word has to stand on its own. The following code works for a single word: def createStandaloneWordRegex(word): """ return a regu