Question: I have a combo box which gets data from a database and a list box which also gets data from a database.

Now what I'd like to do is change the value on the list box depending on the value of the combo box.

For example of if I select “apple” from a combo box, then in the list it should display the types of apples. 

In this case let’s say the types of apples are Granny Smith, Red Delicious, and so on. I hope you guys get what I am trying to say. I have not started to code but I need a method that will allow me to get the desired output. And also I am new to asp.net with vb.

Answer: 
You need to match the number inside with something like:

```
replace(/\/s[0-9]+\//, '/s' + image_size + '/')

```

Here's an example: <http://jsfiddle.net/nfDea/>

Another option is to capture the beginning and end only, in order to concatenate:

```
replace(/(\/s)[0-9]+(\/)/, "$1" + image_size + "$2");

```

<http://jsfiddle.net/nfDea/1/>

If you are actually referring to a variable called `uh`, then you need to use the following:

```
var re = new RegExp("/s(" + uh + ")/");
a = a.replace(re, "/s" + image_size + "/");

```

<http://jsfiddle.net/nfDea/4/>

or

```
var re = new RegExp("(/s)" + uh + "(/)");
a = a.replace(re, "$1" + image_size + "$2");

```

<http://jsfiddle.net/nfDea/3/>
```
var reg = new RegExp('/s' + uh);
...
img[0].src.replace(reg, '/s' + img_thumb_width + '/') 

```