[Tutor] Re: test if file is not ascii
Alan Gauld
alan.gauld at blueyonder.co.uk
Sat Nov 1 12:50:21 EST 2003
> ... have you tried a regular expression?
Great minds think alike...
> bb = 'this is the search string that I want to see is in it...'
> if re.search('[\x00-\x19]',bb):
But for some reason I didn't think a range would work
- I don't know why!?!
> However, I don't know off the top of my head how to specify special
> characters in regexps... What I listed might work,
It seems to in the short test I did.
Alan G
More information about the Tutor
mailing list