pytorch/scripts/release_notes
Thomas Zhang d78b638a31 Convert string => raw strings so char classes can be represented in Python regex (#50239)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/50239

Convert regex strings that have character classes (e.g. \d, \s, \w, \b, etc) into raw strings so they won't be interpreted as escape characters.

References:
Python RegEx - https://www.w3schools.com/python/python_regex.asp
Python Escape Chars - https://www.w3schools.com/python/gloss_python_escape_characters.asp
Python Raw String - https://www.journaldev.com/23598/python-raw-string
Python RegEx Docs - https://docs.python.org/3/library/re.html
Python String Tester - https://www.w3schools.com/python/trypython.asp?filename=demo_string_escape
Python Regex Tester - https://regex101.com/

Test Plan: To find occurrences of regex strings with the above issue in VS Code, search using the regex \bre\.[a-z]+\(['"], and under 'files to include', use /data/users/your_username/fbsource/fbcode/caffe2.

Reviewed By: r-barnes

Differential Revision: D25813302

fbshipit-source-id: df9e23c0a84c49175eaef399ca6d091bfbeed936
2021-01-08 11:17:17 -08:00
..
categorize.py Drop unused imports from scripts (#49956) 2021-01-04 16:08:28 -08:00
commitlist.py Convert string => raw strings so char classes can be represented in Python regex (#50239) 2021-01-08 11:17:17 -08:00
common.py
requirements.txt
test_release_notes.py