# RegExp Value Between a Hard Coded Variable and &

**URL:** <https://forum.kirupa.com/t/regexp-value-between-a-hard-coded-variable-and/301328>\
**Category:** flash\
**Created:** [December 7, 2009, 8:41pm UTC](https://forum.kirupa.com/t/regexp-value-between-a-hard-coded-variable-and/301328 "2009-12-07T20:41:08Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Digitalosophy](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/digitalosophy/32/1114_2.png) [@Digitalosophy](https://forum.kirupa.com/u/Digitalosophy)\
**Post date:** [December 7, 2009, 8:41pm UTC](https://forum.kirupa.com/t/regexp-value-between-a-hard-coded-variable-and/301328/1 "2009-12-07T20:41:08Z")

</div>

Hey guys,

I have a string that looks like

[site=somewhere&content1=foo&content2=1469&somethingelse=something](http://something.com/html.ng/site=somewhere&content1=foo&content2=1469&somethingelse=something)

I need to dynamically replace the content2 variable on the fly with a new value.

So for example I will randomly need to change 1469 to “dave is a cool flash dev” or something like that.

For the life of me, I can’t wrap my head around Reg Exp’s. How can I just say take everything after content2= and before the next & and replace it with “foo”.

TIA.
