You are viewing an old revision of this post, from November 24, 2016 @ 04:47:55. See below for differences between this version and the current revision.

Wildcard Find & Replace in Sublime Text

As seen here: https://www.kevinleary.net/wildcard-find-replace-sublime-text/ This should have been easier for me to understand, but regex still gives me headaches. For anyone wanting to run a search and replace in Sublime Text that contains wildcard values this can be used:
[^<]+
For example, we could use the following search string to find a set of anchor links.
<a href="[^<]+" data-attribute="Something special">[^<]+</a>
Find and replace regex wildcard in Sublime Text Using this in the Find: field within Sublime Text 2/3 would match both of the following links:
<a href="http://www.kevinleary.net/blog" data-attribute="Something special">Blog</a>
<a href="http://www.kevinleary.net/about" data-attribute="Something special">About</a>
Just make sure you have the regex option selected, it looks like a fancy asterisk character and it’s the option farthest to the left in the search dialog. See the screenshot below for details.

Revisions

  • November 24, 2016 @ 04:47:55 [Current Revision] by PeterLugg
  • November 24, 2016 @ 04:47:55 by PeterLugg

Revision Differences

There are no differences between the November 24, 2016 @ 04:47:55 revision and the current revision. (Maybe only post meta information was changed.)

Tags: ,

No comments yet.

Leave a Reply