Regular expression – regular expression matches any URL parameter value (Perl syntax)

I’m trying to find a pattern that allows me to select the value part of the Parameter = Value element of the URL string. I hope it is generic enough that I can replace the “parameter” with any term and Retrieve its value.

For example, if the URL string is (it always follows this regular form):

‘http://www.mysite.com/home .aspx?userid=53&transaction=2&viewport=property’

I need to be able to get the get value part of userid or transaction or viewport, or selectively.

Preferably, it is like It’s as easy to add a parameter name, and it matches the &= behind it. I try to make a universal matching string… It’s bad.

I can’t use javascript functions or anything, it must be a regular perl-like Expression matching
(If you are curious, this applies to Apache JMeter).

I suck on regular expressions: – /Thanks in advance for any help.

< div class="content-split">

If it must be a regular expression,

/userid= ([^&]*)/

I am trying to find a pattern that allows me to select the value part of the Parameter = Value element of the URL string. I hope it is enough Generic, I can replace the’parameter’ with any term and retrieve its value.

For example, if the URL string is (it always follows this normal form):

‘http://www.mysite.com/home.aspx?userid=53&transaction=2&viewport=property’

I need to be able to get the get value part of userid or transaction or viewport, or selectively.< /p>

Preferably, it is as easy as adding a parameter name, and it matches with the &= behind it. I try to make a universal matching string…it sucks.

I can’t use javascript Function or anything, it must be a Perl-like regular expression match
(If you are curious, this applies to Apache JMeter).

I suck on regular expressions: – /Thanks in advance for any help.

If it must be a regular expression,

/userid=([^&]*)/

Leave a Comment

Your email address will not be published.