Re: [Tutor] regex problem with colon

2009-08-07 Thread Kent Johnson
On Thu, Aug 6, 2009 at 11:37 PM, Tim Johnson wrote: >  Yes. You nailed it Kent. >  I had grokked the logic but not entirely the syntax. >  I'm looking thru docs now. Just curious .. is there a flag that >  enables adding a ':' to the internal list of "word" characters? No. The list is affected by

Re: [Tutor] regex problem with colon

2009-08-06 Thread Tim Johnson
* Kent Johnson [090806 18:31]: > On Thu, Aug 6, 2009 at 8:47 PM, Tim Johnson wrote: > > using python 2.5. > > I'm having a problem with including a colon as part of a substring > > bounded by whitespace or beginning of line. > > Here's an example: > > p = re.compile(r'\bcc:\b',re.IGNORECASE) > >>>

Re: [Tutor] regex problem with colon

2009-08-06 Thread Kent Johnson
On Thu, Aug 6, 2009 at 8:47 PM, Tim Johnson wrote: > using python 2.5. > I'm having a problem with including a colon as part of a substring > bounded by whitespace or beginning of line. > Here's an example: > p = re.compile(r'\bcc:\b',re.IGNORECASE) res = p.findall('malicious cc: here CC: ther

[Tutor] regex problem with colon

2009-08-06 Thread Tim Johnson
using python 2.5. I'm having a problem with including a colon as part of a substring bounded by whitespace or beginning of line. Here's an example: p = re.compile(r'\bcc:\b',re.IGNORECASE) >>> res = p.findall('malicious cc: here CC: there') >>> res [] ## Darn! I'd hope that the 'cc:' and 'CC:' subs