Regex: Select text/string between symbols that contains another symbol (tags that contains specific string)

Search for : =>.*(\[|\]).*=>

Explanation:

  • .* - zero or more characters
  • (one|two) - one or the other
  • \[ - the character [ escaped.

Screenshot from notepad++:


enter image description here


  • Ctrl+F
  • Find what: (?<==>)[^=>]*[][][^=>]*(?==>)
  • CHECK Wrap around
  • CHECK Regular expression
  • Find All in Current Document

Explanation:

(?<==>)     # positive lookbehind, make sure we have => before
[^=>]*      # 0 or more any character that is not = or >
[][]        # character class, matches [ or ]
[^=>]*      # 0 or more any character that is not = or >
(?==>)      # positive lookahead, make sure we have => after

If you want to catch also =>, use: =>[^=>]*[][][^=>]*=>


Screenshot (before):

enter image description here

Screenshot (after):

enter image description here