Thank you! I had totally forgot about that. It works.
--
http://mail.python.org/mailman/listinfo/python-list
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
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'
[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
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