Home Download Buy Blog Forum Support

bug with python raw string regex highlighting square bracket

bug with python raw string regex highlighting square bracket

Postby drevicko on Tue Sep 03, 2013 8:17 am

If you enter one of the following in a python-highlighted file, the string closure is not recognised (so the remainder of the file is highlighted as in purple (that's as regex characters I guess):
Code: Select all
# a raw string with an open bracket:
r'['

# this is a valid regex, but breaks the highlighting too...
r'[[\]]'

print "oh no! Where's the syntax highlighting?"

# ] this close bracket will turn the highlighting back on for subsequent text...
print "phew! The syntax highlighting has returned!"

Note that the second string is a valid regex that matches either a '[' or a ']'. This is the same for triple quoted raw strings.
drevicko
 
Posts: 1
Joined: Tue Sep 03, 2013 8:04 am

Return to Technical Support

Who is online

Users browsing this forum: No registered users and 15 guests