block-comment macro broke in TP 7
Posted: Thu Sep 05, 2013 6:47 pm
I just upgraded from TP5 to TP7.0.9.
I have used the following regex substitution (stored as a macro) for years to comment out selected blocks of code:
Example
This looks like a regex bug to me. If so, I'd like to request a prompt fix. If not, I'd like to understand why it now works as it does, and how I can get the new regex engine to do what I want.
I have used the following regex substitution (stored as a macro) for years to comment out selected blocks of code:
- find: ^
- replace with: #
Example
- Before:
Select 1st 4 lines, and do substitution. Result:
Code: Select all
if len(sys.argv) > 2: flUDP = ( len(sys.argv) == 3 and sys.argv[2] == 'udp' ) flSNMP = ( len(sys.argv) == 3 and sys.argv[2] == 'snmp' ) flIP = ( len(sys.argv) == 3 and sys.argv[2] == 'ip' ) flTCP = ( len(sys.argv) == 3 and sys.argv[2] == 'tcp' ) parse_class = UDPCode: Select all
# if len(sys.argv) > 2: # flUDP = ( len(sys.argv) == 3 and sys.argv[2] == 'udp' ) # flSNMP = ( len(sys.argv) == 3 and sys.argv[2] == 'snmp' ) # flIP = ( len(sys.argv) == 3 and sys.argv[2] == 'ip' ) flTCP = ( len(sys.argv) == 3 and sys.argv[2] == 'tcp' ) parse_class = UDP - In TP 7.0.9:
Select 1st 4 lines, and do substitution. Result:Code: Select all
# if len(sys.argv) > 2: # flUDP = ( len(sys.argv) == 3 and sys.argv[2] == 'udp' ) # flSNMP = ( len(sys.argv) == 3 and sys.argv[2] == 'snmp' ) # flIP = ( len(sys.argv) == 3 and sys.argv[2] == 'ip' ) # flTCP = ( len(sys.argv) == 3 and sys.argv[2] == 'tcp' ) parse_class = UDP
This looks like a regex bug to me. If so, I'd like to request a prompt fix. If not, I'd like to understand why it now works as it does, and how I can get the new regex engine to do what I want.