I have a file with the following grammar:
<whitespace_sequence><string><whitespace_sequence><--More--><whitespace_sequence><string_sequence><newline>
Using Python (2.4), I would like to remove the sequence:
"<whitespace_sequence><--More--><whitespace_sequence>" from the above grammar.
I am using the following regex pattern:
x = re.compile("(\s+)("--More--")(\s+)")
but it’s not matching the sequence that I need to remove.
It looks like the problem with your regex is the double quotes. Without them, it works fine:
FWIW, here is a great resource for developing a regex directly from a sample string:
http://txt2re.com/
Another good resource to learn more about regular expressions is: http://www.regular-expressions.info/