Last active
August 29, 2015 14:10
-
-
Save stchr/1260db16e64efeb19b96 to your computer and use it in GitHub Desktop.
regex replace to give class method calls and new object instances a backslash for global namespace
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class methods | |
search: (?<![\\A-Z])([A-Z]+::{1,1}[A-Z]+\() | |
replace: \\$1 | |
class constants | |
search: (?<![\\A-Z])([A-Z]+::{1,1}[A-Z]+) | |
replace: \\$1 | |
new instances | |
search: (new )(?<![\\A-Z])([A-Z]+\() | |
replace: new \\$2 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment