Home Download Buy Blog Forum Support

Find Regex Bug

Find Regex Bug

Postby adzenith on Tue Oct 23, 2012 9:15 pm

In Python, regex searching for \' is identical to regex searching for '.
In Sublime Text 2, regexg searching for \' finds nothing, whereas regex searching for ' finds all single-quotes.
This appears to be a problem for ', <, >, and ` (single quote, less than, greater than, and backtick), but for no other characters.
The problem comes up because re.escape puts a backslash in front of all non-alphanumeric characters, which breaks strings that have one of these four trouble characters in them.
Thanks to tito for finding this!
Posts: 1403
Joined: Mon Oct 19, 2009 9:12 pm

Return to Technical Support

Who is online

Users browsing this forum: aakashchyaeva, Yahoo [Bot] and 26 guests