93

Is there a way I can enable multi-selection with regex? I don't want to do search and replace, I just want to highlight/select all of the matches according to regex.

Is this possible?

2 Answers 2

223

Sure. Press Ctrl+F, then type your regex pattern and hit Alt+Enter

5
  • 2
    Found this very useful. I wonder why ALT+F3 doesn't do the same thing i.e. it works when you mouse select.
    – user
    Commented Aug 28, 2013 at 7:05
  • 10
    instead of Alt+Enter you can also click 'Find All'
    – user1115652
    Commented Dec 28, 2014 at 15:07
  • 1
    (of course, regex mode must be on: cmd+alt+r on OSX)
    – ptim
    Commented Feb 13, 2015 at 10:53
  • 1
    What about incrementally adding regex matches? If I use Ctrl+D, it replaces the regex with the first concrete match instead.
    – David
    Commented Mar 16, 2018 at 18:40
  • 1
    This does not seem to work with the "Find in Files" option, just searching an individual file.
    – allicarn
    Commented Dec 4, 2018 at 13:33
1

You can activate/deactivate the regex mode in the search view clicking this icon:

enter image description here

Note that there is also a shortcut to activate it: Alt+R by default.

2
  • 1
    It's cmd + alt + R, not alt + R.
    – medik
    Commented Jul 10, 2018 at 13:44
  • 2
    I was talking about the Windows shortcut. I don't know what it could be on Mac, but feel free to update my answer :-)
    – Mistalis
    Commented Jul 11, 2018 at 13:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.