regex query

km km at mrna.tn.nic.in
Fri Jun 11 19:18:14 CEST 2004


 Hi all,
how do i include variable as a part of the regex string ? - i mean variable interpolation. like : 
##########code ##########
#!/usr/bin/env python
import re
str = "abc"
p = re.compile('str')  # defeats the purpose - literal string 'str'
##########code ##########
any suggestions ? 

thanks in advance 
KM





More information about the Python-list mailing list