replace characters in notepad++ BUT exclude characters inside single quotation marks(2nd)

[亡魂溺海] 提交于 2019-11-29 16:50:51

Could combine a recursive part for getting '... '.... abc '' and use \K for resetting after. This is the part that needs to be skipped. And using kind of the trick, matching remaining words in pipe:

'\s*(?0)?[^']*'\K|(\w+)
  • (?0)? here the pattern is optionally pasted from start
  • \s is a shorthand for whitespace character [ \t\r\n\f]
  • \w is a short for word character [A-Za-z0-9_]

And replace with \L\1 to lower words captured inside the first capture group or \U\1 to upper.
Works for me in NP++ 6.7.9.2 with your sample data. See regex101 for testing the pattern.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!