Can you help me understand the difference between $n and \n to refer to the content captured between (), please?
I have an XML file where every record is in a single line, so I search for
Code: Select all
</(.+?)><
Code: Select all
</$1>\r\n<
Now I realize that some fields in the same file are empty (ex. <MM:section></MM:section>) and want to remove them. So using the same logic as above I search for
Code: Select all
<(.+?)></$1>\r\n
After some testing and researching I realize it does work if I replace $1 with \1. So the issue is resolved. But I don't understand why.
Why did $1 work in the first case but not in the second one? Thank you!