I have a function which accepts regular expression and then does regular exp match on the target string. In python the regular expression has to be prefixed with 'r'. I am not able to do that.
r^[a-zA-Z0-9]{3}_TREE is what I want to get. My function receives '^[a-zA-Z0-9]{3}_TREE'
If I do
'r'+ '^[a-zA-Z0-9]{3}_TREE' then it 'r' also becomes string which is not.
Can you please help me?
But my regex doesn't have escape sequences so using r doesn't matter but then I see another problem. If I am hardcoding the regex in the match statement it is working, but if I call the function and receive it as a string and then use in the function it is not working. What am I doing wrong?