Text replace with regex in SQL Server
- by Thiyaneshwaran S
Currently I have a SQL server column of type nvarchar(max) which has text that starts with
<span class="escape_<<digits>>"></span>
The only thing that varies in the pattern is the <<digits>> in the class name.
The common part is
<span class="myclass_
and the closing
</span>
Some sample values are
<span class="myclass_12"></span>
<span class="myclass_234"></span>
<span class="myclass_4546"></span>
These span text are present only at the beginning of the column. Any such matching span in the middle should not be removed or matched.
Whats the SQL Server query with regex to remove all these occurances of span?