Avatar ·

Using a variable in a regular expression in Python

📁 Advanced Python Topics, AI

Hello! Please help me solve what seems trivial, but due to lack of programming experience, it's an absolutely unusual task for me :)

mt = re.findall(r'\\'"variable"\\s\\')

Instead of "variable" there should be a variable that will take different values, and I don't know how to correctly represent it.