I'm writing regular expressions in my DB. This question is not Why (I know why) is how to solve-it. I just solve the first match "\n" with the a.decode('string_escape'). But I don't know how to solve the "\s".
When Django returns me the field of the regex insted of my database field:
"Detected PHP\nVersion:\s"
Returns me:
"Detected PHP\\nVersion:\\s"
for me, retrieve the value unmodified or be able to change \n for \n and \s for \s are useful.
I'm trying:
**Replace works but only with print
>>> print a.replace('\\\\', '\\')
Detected PHP\nVersion:\s
>>> a.replace('\\\\', '\\'))
'Detected PHP\\nVersion:\\s'
Also decode string_escape works, but just with the \n not with \s:
a.decode('string_escape')
'Detected PHP\nVersion:\\s'
I want to recover from my db the string without the double slashes. Any help would be appreciated.