# Short answer:
# The regex expression is a string which can be built up like any string in
# Python
# Example usage:
import re
your_string = 'Your string to search'
variable = 'ring'
re.search('.+' + variable + '.+', your_string) # or:
re.search('.+{}.+'.format(variable), your_string)
import re
s = 'I love books'
var_name = 'love'
result = re.search('(.+)'+var_name+'(.+)',s)
print result
var_name = 'hate'
s2 = 'I hate books'
result = re.search('(.+)'+var_name+'(.+)',s2)
print result