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
_______________________________________________
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor

Reply via email to