I need a way to find a span tag inside an HTML and replace the value between the span tag, by using regex. But it should only replace if the span tag contains a specific attribute For example
<span a="hello">a</span><span>b</span>
needs to become <span a="hello">c</span><span>b</span>
Is this possible to do in regex? Why I need to do this with regex is because this code runs on the server side and don't have access to allot of fancy Javascript functions.