Is it possible to include string variable itself in Regex pattern?
text="Sample text is"
st="text"
r=re.findall("[A-Z]+[st]+",text)
print(r[:])
Resaon is I need regex pattern in loop, so st string variable will be not fixed and will be changing, so I can not write Regex pattern as just "text". Or it is not possible? Thanks!