My experience is the same as that of prometheuzz - HTML is almost always best handled by the HTML DOM.
The problem with your pattern is that it looks for a single digit and will replace it with a null string. Therefore your code will remove all digits from the text.
If you want a pattern that will do what you said - "to strip out the width element" - then you need a pattern that will do what you actually need; something like:
width="\d*"
This will start the match with the "width=" keyword, match the first double-quote, any digits that follow and then the trailing double quote.
Remember that you will need to modify the pattern to make sure that it is recognised correctly by the regex function. Specifically you will need to add in the delimiters (as in your pattern) and, because there are double-quotes in the pattern which is specified within a double-quoted string, you will need to escape them in whatever way your programming language requires.
A final word of caution: this pattern will only work on text such as your example. It will not work if the number is not surrounded by double-quotes (which I think is quite common) and it will also remove any "width=..." text form anywhere within the text (especially if it is more than just the single tag you have shown).
Susan