Home Download Buy Blog Forum Support

Regex find between tags

Regex find between tags

Postby jlippiner on Tue Jan 17, 2012 2:35 pm

The jQuery snippets are incorrect in the latest version of Sublime. The $ are not escaped and need to be.

For example:

Code: Select all
   <content><![CDATA[\$(${1/(.+)/(?1:':)/}${1:string/element/array/function/jQuery object/string, context}${1/(.+)/(?1:':)/})$0]]></content>
   <description>$('select DOM Element')</description>

I figured out that I could search for something like this with regex turned on

Code: Select all

to replace all non-escaped dollar signs, however, I need to limit it to ONLY non-escaped dollar signs inside the <content></content> tags.

I can't seem to get this to work. Any thoughts?
Posts: 4
Joined: Sun Nov 20, 2011 12:28 pm

Re: Regex find between tags

Postby facelessuser on Tue Jan 17, 2012 3:19 pm

you could maybe try something like this

Code: Select all

and replace with
Code: Select all

You would have to run it multiple times though since regex is not really recursive: it can only find a finite number of matches, so you would have to run it until all you don't find any more.

Hope that helps, or maybe someone has something better.
Posts: 1780
Joined: Tue Apr 05, 2011 7:38 pm

Return to Technical Support

Who is online

Users browsing this forum: Google [Bot] and 17 guests