VBSscript regex replace text between curly

I have looked at multiple expamples here and they all partially work but not all together.I am trying to create a regex to replace text in a string based on an variable. I get the replace to work, but only on the first search. etc. The goal is to replace: Text: {1} Text from user 1.
{2} Text from user 2.
{1} Text from user 1.
- When if the QueryString. I need to replace the text between the { }. If QueryString = a user # for example 1 then show name, otherwise Show "User None":Respone: Text: NAME1 Text from user 1.
User None Text from user 2.
NAME1 Text from user 1.
- When if the QueryString. I need in ASP VBscript. I am typing this from memory and running out the door, but any help would be appreciated.\[code\]Dim idtest, strgidtest = Request.QueryString("x")strg = "{1} Text from user 1.<br/>{2} Text from user 2.<br/>{1} Text from user 1.<br/>"Set re = new RegExp re.IgnoreCase = true 'ignore case when matchingre.Global = truere.Pattern = "/{(.*)}/" set matches = re.Execute(strg)if matches > o thenResponse.Write matches.item(0).submatches(0) \[/code\]etc etc... I have to run but I hope you know what I am looking for. Thanks in advance!
 
Back
Top