On Wed, 27 Apr 2005, Tom Tucker wrote:
> Hello all! I am trying to pass a variable to my re.compile string (see
> broken example below). Is something like this possible? Thanks!
>
> regexstring = 'H\sb'
> textstring = 'BLAH blah'
> match = re.compile((%s) % (regexstring)) # ?
Hi Tom,
Ah, I t
Hello all! I am trying to pass a variable to my re.compile string (see
broken example below). Is something like this possible? Thanks!
regexstring = 'H\sb'
textstring = 'BLAH blah'
match = re.compile((%s) % (regexstring)) # ?
if match.search(line):
print "I found it!"
Tom
___