Reputation: 40395
I am looking for a regex query that would allow me to retrieve a value from a string here are examples of my string:
home.aspx?StudyID=0020101&aa=72
randompage.aspx?studyid=3023603&aa=40
myconfig.aspx?studyid=0021600&aa=40
I need to get the numerical value of the 'studyid'
variable, please note that the name of the page will change so simply doing the substring and counting char spaces didn't work
I unfortunately cannot use request.querystring method as this string is stored in the database and a select statement will be used for running this regex query
Thanks
Upvotes: 0
Views: 159
Reputation:
Use can use parenthesis to capture values in regex.
Therefore, you can match the string to studyid=(\d+)
and get the value using $1.
Upvotes: 1