92

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?

kba
  • 19,333
  • 5
  • 62
  • 89
Allen
  • 3,601
  • 10
  • 40
  • 59

2 Answers2

220

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

theta
  • 24,593
  • 37
  • 119
  • 159
  • 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 Aug 28 '13 at 07:05
  • 9
    instead of Alt+Enter you can also click 'Find All' –  Dec 28 '14 at 15:07
  • 1
    (of course, regex mode must be on: cmd+alt+r on OSX) – ptim Feb 13 '15 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 Mar 16 '18 at 18:40
  • 1
    This does not seem to work with the "Find in Files" option, just searching an individual file. – allicarn Dec 04 '18 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.

Mistalis
  • 17,793
  • 13
  • 73
  • 97