问题
I need to replace a bunch of lines for SQL queries
The format is like
"xyzabcd > hdsd + 5 and",
"xzbcd_TTM_dfdfd > hdsd + 20 and",
"x_TTM_dfsddsdsdfd > hdsd + 20 and"
I need to find the keyword TTM and add a "(" at the beginning and " or some condition)" in the end but before the word "and"
So the line
"xzbcd_TTM_dfdfd > hdsd + 20 and",
becomes
"(xzbcd_TTM_dfdfd > hdsd + 20 or some condition) and
I am trying to do it in Textpad but I can also use Notepad++. Thanks a lot in advance.
回答1:
For Notepad++ and for TextPad you can use
Search:
"(.+)\sand",*
Replace:
"\(\1 OR some condition\) AND
来源:https://stackoverflow.com/questions/35814461/regular-expressions-to-replace