Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Multi-selection with regex (sublime text 2)

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?

like image 252
Allen Avatar asked Jun 02 '13 08:06

Allen


People also ask

How do I select multiple items in Sublime Text?

Multiple Selections To select multiple regions using the keyboard, select a block of text, then press Ctrl+Shift+L to split it into one selection per line. When you're done with using multiple selections, just press Ctrl+K to trim all but the first.

Does Sublime Text support RegEx?

Search functions in Sublime Text support regular expressions, a powerful tool for searching and replacing text. Regular Expressions find complex patterns in text.

Can RegEx be nested?

NET RegEx engine is capable of matching nested constructions. Let's see some code. Now, let's say that the task is to match nested <div> 's in HTML code. String pattern = @" (?#

How do I select every other row in sublime?

You can do it easily : Select all your lines, or the whole document Ctrl + A. Add multiple selectors : Ctrl + Shift + L (and in Mac: Command + Shift + L)


2 Answers

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

like image 187
theta Avatar answered Oct 20 '22 18:10

theta


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.

like image 39
Mistalis Avatar answered Oct 20 '22 20:10

Mistalis