diff --git a/tools/refactoring/webrtc_reformat.py b/tools/refactoring/webrtc_reformat.py index e5606fef6..269d1c3f6 100755 --- a/tools/refactoring/webrtc_reformat.py +++ b/tools/refactoring/webrtc_reformat.py @@ -30,8 +30,19 @@ def LowerWord(obj): def DeCamelCase(text): - """De-camelize variable names.""" - pattern = re.compile(r'(?<=[ _*\(\&\!])([a-z]+)(? string_likeThis -> string_like_this. + """ + possible_tokens_before_vars = '[ _*\(\&\!\[]' + pattern = re.compile(r'(?<=' + possible_tokens_before_vars + ')' + + # Match some lower-case characters + '([a-z]+)' + + # Don't match kFoo, !kFoo, [kFoo], etc + '(?