Q:

Change width and height RegEx javascript

Please help me change string:
<img src="hello.jpg" alt="^__^" width="100" height="76" />

to
<img src="hello.jpg" alt="^__^" width="200" height="150" />

using regular expression.
New information::
I have a product item and in  stores information about different variables for this product
    <tr>
        <td><img src="_tmp/gesan/benzin/G3000H.jpg" alt="G3000H" width="100" height="76" /></td>
        <td>G3000H</td>
        <td>2.2 kv</td>
        <td>2.75 ka</td>
        <td>3,6</td>
        <td>1,3</td>
        <td>39,7кг</td>
        <td>2000 rub</td>
    </tr>

when you hover this  element a new PopUp menu appear with help of this javascript:
$("tr:gt(0)").hover(function(){
    $(this).css({'background-color':'#ccc'});
    $(this).each(function(){
        var itemImage = this.cells[0].innerHTML;itemImage2 = itemImage.replace(/(width=")\d+("\W+height=")\d+/, '$1200$2150');
        var itemName = this.cells[1].innerHTML;
        var itemPowerkVa = this.cells[2].innerHTML;
        var itemPowerKVt = this.cells[3].innerHTML;
        $("body").append("<div id='tip'><div id='tipWrap'>"+ itemImage2 +"<h4>"+ loadContainerArr[0]+" "+ itemName +"</h4><ul><li>"+ itemPowerkVa +"</li><li>" + itemPowerKVt +"</li></ul></div></div>");
    });
    tipItem  = $("#tip");
    tipItem.show(); //Show tooltip
},function() {
    tipItem.hide(); //Hide tooltip
    $(this).css('background-color','transparent');
    tipItem.remove();
})

and i suppose in this situation it's better to use RegEx, than create a new Object

A:

If you really want to use a regex:
str.replace(/(width=")\d+("\W+height=")\d+/, '$1200$2150');

Note that your 200 and 150 are part of "$1 200 $2 150"
But I'll 2nd the other comments that say there are better ways to do this.

