Skip to content

Commit

Permalink
Updated Notes section about r vs. R regexes
Browse files Browse the repository at this point in the history
  • Loading branch information
MattDMo committed Dec 5, 2015
1 parent 52376a0 commit 6b45aee
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ def myfunc(self, # gotta have self
## Notes

- 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 :)
- 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.
- 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.
- 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.
- 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.
Expand Down

0 comments on commit 6b45aee

Please sign in to comment.