Select all found RegEx results in Atom

Aaron Critchley picture Aaron Critchley · Sep 10, 2015 · Viewed 17.4k times · Source

I'm trying to select all of the results found by a regex find so I can modify them all (not replace them with text!), for example, making them all uppercase with Cmd + K -> Cmd + U. I'm aware that I could do them one by one via repeating Cmd + G, Cmd + K, Cmd + U, but for a large file this simply isn't practical or realistic. I'm also aware of using bash and may other scripting alternatives, I'd like to find a way to do it inside Atom, I'm happy to install an external library if needed.

Example of selection

Things I've tried:

  1. Cmd + D, this just selects the next instance of that exact letter, not the next result matching the regex.
  2. Cmd + Shift + G and alternatives (alt/right shift/ctrl), Cmd + G selects the next result matching the Regex, which is in the right direction.
  3. Changing all of the selected text to a unique string, highlighting them all, pressing Cmd + Z and hoping it will stay selected, it doesn't.
  4. Lots of Googling and reading though Atom discussions.
  5. Reading Atom's documentation on the subject

Answer

Johno picture Johno · Oct 13, 2015

Pressing Alt + Enter will select all instances matching your Find results. This works for RegEx search also.

Source: https://github.com/atom/find-and-replace/pull/290