Example, I have a file that contains many many of the next:
"xxxxxx".toLowerCase() xxxxxx - some text with variable length.
I want to replace it with:
castlowercase("xxxxxx") I don't find how to make a regular expression. It's better to take everything between ( ) cause there may be some variable, not just a string...
22 Answers
- Ctrl+H
- Find what:
("[^"]+")\.toLowerCase\(\) - Replace with:
castlowercase\($1\) - check Match case
- check Wrap around
- check Regular expression
- Replace all
Explanation:
( # start group 1 " # a quote [^"]+ # 1 or more any character that is not a quote " # a quote ) # end group 1 \. # a dot toLowerCase\(\) # literally toLowerCase() Replacement:
castlowercase # literally \( # openning parenthesis, must be escaped in Notepad++ $1 # content of group 1 (i.e. "xxxxxxx") \) # closing parenthesis, must be escaped in Notepad++ Result for given example:
castlowercase("xxxxxx") Screen capture:
Notepad can't do regular expressions. It is a very basic editor.
So you are asking the impossible.
