سؤال

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?

هل كانت مفيدة؟

المحلول

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)

نصائح أخرى

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.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top