Re: Python regular expression question!

2006-09-20 Thread unexpected
Sweet! Thanks so much! -- http://mail.python.org/mailman/listinfo/python-list

Re: Python regular expression question!

2006-09-20 Thread Ant
unexpected wrote: > > \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-. > > > > So is there a way to get \b to include - ? No, but you can get the behaviour you want using negative lookaheads. The following regex is effecti

Re: Python regular expression question!

2006-09-20 Thread unexpected
> \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-. > So is there a way to get \b to include - ? -- http://mail.python.org/mailman/listinfo/python-list

Re: Python regular expression question!

2006-09-20 Thread Hallvard B Furuseth
"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

Python regular expression question!

2006-09-20 Thread unexpected
I'm trying to do a whole word pattern match for the term 'MULTX-' Currently, my regular expression syntax is: re.search(('^')+(keyword+'\\b') where keyword comes from a list of terms. ('MULTX-' is in this list, and hence a keyword). My regular expression works for a variety of different keyword