rufustank wrote:I'm a bit of a noob with Sublime and I've spent hours looking for the answer but can't seem to find the solution.
I am using regex to find and replace. Regex seems to work for "finding" code/text but if I want to paste using regex, it just pastes the regex commands and not the results of the command. I can't seem to find anything to turn on or off this functionality but I see people talking about being able to do it.
Text: geography<a href="../Text/Glossary.html#geography"><span class="glossary"></span></a>
Find: <span class="glossary">.\d*.</span>
I want this: <a href="../Text/Glossary.html#geography">geography</a>
I get this instead: <a href="../Text/Glossary.html#geography">^\w*</a>
How can I fix this? Thanks!
The Guv wrote:Thank you, thank you, thank you, thank you Pete340!!!!!!
After hours of searching (well ok, an hour of searching), your post has been the only one that has made sense on how to do a search and replace with regex. As a designer, most of the answers on stackoverflow etc. just doesn't make sense, but yours finally let me change tags while leaving content. Brilliant!
And for anyone else searching, the way to change/replace tags while leaving the content is:
Original: <span class="text-italics">my content here</span>
Find what: <span class="text-italics">(.*)</span>
Equals: <em>my content here</em>
Just a caution: this won't do what you want if you have a nested span. For example, it will turn
<span class="text-italics">something <span something-else>more stuff</span></span
<em>something <span something-else>more stuff</em></span
Users browsing this forum: Google [Bot] and 12 guests