Sublime Forum

Bug in Hyphen matching in Regular Expression package

#1

There’s an issue with the bundled RegExp syntax.
A hyphen at the end of a character class should be match a literal hyphen but the syntax definition treats it as part of a character range declaration. (se the linked issue)
One fix is to replace the pattern .-. with .-^]]

                <dict>
                    <key>match</key>
                    <string>.-^\]]</string>
                    <key>name</key>
                    <string>constant.other.range.regexp</string>
                </dict>
0 Likes