Search and Replace with RegEx components in Atom editor

RegexAtom Editor

Regex Problem Overview


I want to search and replace this

`https://example.com/`{.uri}

to

[https://example.com/](https://example.com/)

With vim I would do a s/(http.*){.uri}/[\1](\1)/g but that doesn't work with atom.io. How can I solve this?

Regex Solutions


Solution 1 - Regex

If you Cmd-F and open the search pane, there is a ".*" button at the right side. Click it and now it's regex mode.

I find

(http.*)\{\.uri\}

and replace to

[$1]($1)

Solution 2 - Regex

Juste to update @speedogoo's answer for future readers, if you do not find the regex mode in the search view, it looks like this:

enter image description here

You can also open it with the shortcut Ctrl+Alt+/ (default).


Note that even ^ and $ are already supported by Atom's find-and-replace.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionwintermeyerView Question on Stackoverflow
Solution 1 - RegexspeedogooView Answer on Stackoverflow
Solution 2 - RegexMistalisView Answer on Stackoverflow