Hello
the string is = "Reg.asp?q=RG_Price=5000*8000,Activated=1"
and i want to replace "RG_Price=5000*8000" with that "Price BETWEEN 5000 AND 8000".
Is that possible with Regular Expressions in ASP ?
Hello
the string is = "Reg.asp?q=RG_Price=5000*8000,Activated=1"
and i want to replace "RG_Price=5000*8000" with that "Price BETWEEN 5000 AND 8000".
Is that possible with Regular Expressions in ASP ?
Sure (now with VBScript instead of C#):
Dim queryString, replacedString
Set regEx = New RegExp
regEx.Pattern = ".+RG_Price=(\d+)\*(\d+).*"
replacedString = regEx.Replace(queryString, "Price BETWEEN $1 AND $2")
I would use this regular expression:
^[^?]*\?(?:[^&]*&)*q=RG_Price=(\d+)\*(\d+)
and replace the match with "Price BETWEEN $1 AND $2"
.
But I don’t know ASP.NET so I cannot give you a working example.