I am searching a string by using re
, which works quite right for almost all cases except when there is a newline character(\n)
For instance if string is defined as:
testStr = " Test to see\n\nThis one print\n "
Then searching like this re.search('Test(.*)print', testStr)
does not return anything.
What is the problem here? How can I fix it?