替换记事本++中的字符但排除单引号内的字符
replace characters in notepad++ BUT exclude characters inside single quotation marks
我有一个这样的字符串:
SELECT column_name FROM table_name WHERE column_name IN ('A' , 'stu' ,'Meyer', ....);
我想从上到下替换notepad++中的所有字符(反之亦然)但是,从替换中排除单引号内的字符。
condition: It exists no solid structure before/behind the single quotation marks part!
(That means - I can not use the keyword "IN" or signs like "," or "("
or ")" or ";" for this regex ...!)
目标字符串(单引号内的字符必须保持不变):
select column_name from table_name where column_name in ('A' , 'stu' ,'Meyer', ....);
或(反之亦然)
SELECT COLUMN_NAME FROM TABLE_NAME WHERE COLUMN_NAME IN ('A' , 'stu' ,'Meyer', ....);
如何在记事本++中排除单引号部分(替换)?
(我发现单引号部分带有例如 '(.*?)' 或 '(\w+)' 或 '[[:alpha:]]{1,}',..)
我很高兴得到每一个答案,即使你不使用记事本++!
下面的正则表达式将匹配单引号内不存在的所有大写字母。
[A-Z](?=(?:'[^']*'|[^'\n])*$)
Now, right-click on the matched characters and change it to lowercase.
我有一个这样的字符串:
SELECT column_name FROM table_name WHERE column_name IN ('A' , 'stu' ,'Meyer', ....);
我想从上到下替换notepad++中的所有字符(反之亦然)但是,从替换中排除单引号内的字符。
condition: It exists no solid structure before/behind the single quotation marks part!
(That means - I can not use the keyword "IN" or signs like "," or "(" or ")" or ";" for this regex ...!)
目标字符串(单引号内的字符必须保持不变):
select column_name from table_name where column_name in ('A' , 'stu' ,'Meyer', ....);
或(反之亦然)
SELECT COLUMN_NAME FROM TABLE_NAME WHERE COLUMN_NAME IN ('A' , 'stu' ,'Meyer', ....);
如何在记事本++中排除单引号部分(替换)?
(我发现单引号部分带有例如 '(.*?)' 或 '(\w+)' 或 '[[:alpha:]]{1,}',..)
我很高兴得到每一个答案,即使你不使用记事本++!
下面的正则表达式将匹配单引号内不存在的所有大写字母。
[A-Z](?=(?:'[^']*'|[^'\n])*$)
Now, right-click on the matched characters and change it to lowercase.