简体   繁体   中英

Regular expressions in Sublime Text 3

I am trying to make a regular expression that replaces the content of the texts in parentheses.

I have used the following regular expression:

"([A-Za-z ]*)"

But as you can see in the following image does not work:

如你所见,这激活了“正则表达式”功能。[1]

Thank you and greetings.

Remove the double quotes from your expression and escape the parentheses:

\([A-Za-z ]*\)

在此输入图像描述

Details :

  • \\( - a literal (
  • [A-Za-z ]* - zero or more ASCII letters or spaces
  • \\) - a literal ) .

The unescaped (...) form a capturing group that stores a submatch in the memory buffer that can be used later during matching or replacement via backreferences.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM