"unexpected" <[EMAIL PROTECTED]> writes:

> I'm trying to do a whole word pattern match for the term 'MULTX-'
>
> Currently, my regular expression syntax is:
>
> re.search(('^')+(keyword+'\\b')

\b matches the beginning/end of a word (characters a-zA-Z_0-9).
So that regex will match e.g. MULTX-FOO but not MULTX-.

Incidentally, in case the keyword contains regex special characters
(like '*') you may wish to escape it: re.escape(keyword).

-- 
Hallvard
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to