Moogal
Moogal

Reputation: 107

Regex in sublimetext to find specific html element

I want to use regex in sublimetext to find instances of &nbsp; in <td class="danish">&nbsp;</td>

Can anyone please help me with this?

I've used the following elsewhere before: (?<=danish/).+(?=.swf), but the tag brackets are giving me problems.

Upvotes: 0

Views: 1113

Answers (1)

inhan
inhan

Reputation: 7470

In Sublime Text unofficial documentation for Regular Expressions it indicates that

Sublime Text uses the Boost syntax for regular expressions.

So you can use positive lookahead and lookbehinds like in the following Regex, if you're sure your <td> node does not have any data other than you provided.

(?<=\<td class="danish">).*?(&nbsp;)+.*?(?=<\/td>)

Upvotes: 4

Related Questions