Skip to content

Commit 6b45aee

Browse files
author
MattDMo
committed
Updated Notes section about r vs. R regexes
1 parent 52376a0 commit 6b45aee

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ def myfunc(self, # gotta have self
5656
## Notes
5757

5858
- To facilitate hacking, I'm also including my `.YAML-tmLanguage` file in the repo, which I use for my day-to-day work (I really hate debugging regexes embedded in XML). Install [`AAAPackageDev`](https://packagecontrol.io/packages/AAAPackageDev) for syntax highlighting, and tools for converting between YAML, JSON, and XML/Plist formats. [Neon](https://packagecontrol.io/packages/Neon%20Color%20Scheme) of course has great coloring for the `.YAML-tmLanguage` format, and especially the regexes :)
59+
- Speaking of which, for raw/regex strings, regexes will be scoped according to the accompanying `Regular Expressions (Python Improved).tmLanguage` file, instead of the builtin Python regular expressions definition. If you're using **Neon** for syntax highlighting (or any color scheme that highlights regexes), use a lowercase `r` to denote your string as containing a regex (i.e., `r"\b(?i:(0[o]?[0-7]+))"`). However, if you're just using a raw string literal to, for example, define a Windows path and you *don't* want regex highlighing for all the back slashes and whatnot, use an uppercase `R` (`R"C:\Users\MattDMo"`). Python can't tell the difference, but it will look nicer in your editor.
5960
- All Django-related stuff has been removed. If you want it back, just dig through the repo's history and you can find it. It was just too distracting.
6061
- I removed the SQL-related stuff from the string definitions, because 1) somebody complained, and 2) like Django, it was distracting. It didn't cover all of SQL, only highlighted some keywords, and just wasn't worth it.
6162
- Unicode escapes should now appear correctly in all strings, as with Python 3 all strings are Unicode. I think I got it right, if you think otherwise just let me know.

0 commit comments

Comments
 (0)