Code: Select all
^......[^\*][ ]*((([0-9][0-9]|FD|SD|RD|CD)[ ]+)?(([a-zA-Z0-9_-]+)([ ]+SECTION([ ]+([0-9]*))?)?[.]?))?[ ]*COPY[ ]+(((DDS?R?)-((ALL-FORMATS?)|([A-Za-z0-9_]+))(-I-O|-I|-O)?(-INDIC(ATORS?)?)?)|([a-zA-Z0-9_-]+))([ ]+(IN|OF)?[ ]*(([a-zA-Z0-9]+-)?([a-zA-Z0-9]+))?)?
1) At position 8, nothing is highlighted. This happens a couple other places too, the next ones being 17 and 49. It appears that, at least in some cases, the look forward isn't detecting a character that needs to be matched.
2) At position 66, the brace matcher chooses to show the match for the ending brace in position 65 rather than the opening brace at 66. I'm not sure there is a "correct" way to do this, but I would probably have expected the opposite.
3) At position 78 and 83, the same issue as 1) appears.
4) At position 90, a correct ending match is shown. However, at 91, 93, 99, and 100, the ending match shows the same starting match character (position 83), which is wrong. This is probably the most serious issue, since it shows a match this is just incorrect instead of just not quite as expected.
Not sure what's going on here - whether the nesting levels of parens have anything to do with this or not. I had put together a slightly less complicated version of the regex previously, and noticed no issues. That version of the regex is:
Code: Select all
^......[^\*][ ]*(([0-9][0-9]|FD|SD|RD|CD)[ ]+([a-zA-Z0-9_-]+[.]?))?[ ]*COPY[ ]+(((DDS?R?)-((ALL-FORMATS?)|([A-Za-z0-9_]+))(-I-O|-I|-O)?(-INDIC(ATORS?)?)?)|([a-zA-Z0-9_-]+))([ ]+(IN|OF)?[ ]*(([a-zA-Z0-9]+-)?([a-zA-Z0-9]+))?)?
I also don't know if this is new behavior. I'm running 3.97n-beta9. BTW, both are accepted as legal regex by search/replace and appear to work as expected.