Sublime Forum

Regex Search String... Is there a Sublime package for this task?

#1

Is there a plugin that can accomplish this type of search? I looked around the packages site to no avail? If not, can someone assist with the regex for this please?

Best,
William

In the following code, what is the regex (within Sublime’s search) for finding “site” (seen within “Websites”) and /a> (seen within ) only when there are between 0 and 50 characters of any type in between those two strings? I’d like to be able to perform searches like this on a regular basis, just changing out the two keywords and a distance, thanks.

<body>
<!-- Websites navigation menu -->
<ul class="navbar">
<li><a href="index.html">Home page</a>
<li><a href="musings.html">Musings</a>
0 Likes

#2

SublimeText has native RegEx searching.

Use Alt + R to toggle RegEx while you are have the Find panel open.

This pattern will work:
site[\s\S]{0,100}\/a>

“site” + [ all characters including newlines ]{ 0 to 100 times } + “/a>”

##Try It Out Here

1 Like

#3

Hey Thanks! Been at that one a while now

1 Like