a little about regex
Fulvio
fulvio at tm.net.my
Wed Oct 18 09:54:02 EDT 2006
***********************
Your mail has been scanned by InterScan MSS.
***********************
On Wednesday 18 October 2006 16:43, Rob Wolfe wrote:
> |def filter(adr): # note that "filter" is a builtin function also
> | import re
I didn't know it, but my function _is_ starting by underscore (a bit of
localization :) )
> | allow = re.compile(r'.*(?<!\.com)\.my(>|$)') # negative lookbehind
> | deny = re.compile(r'.*\.com\.my(>|$)')
Great, it works perfectly. I found my errors.
I didn't use r ahead of the patterns and i was close to the 'allow' pattern
but didn't give positive result and KregexEditor reported wrong way. This
specially because of '<' inside the stream. I thing that is not a normal
regex input. It's only python valid. Am I right?
More details are the previous thread.
F
More information about the Python-list
mailing list