RegExLib.com - The first Regular Expression Library on the Web!

Please support RegExLib Sponsors

Sponsors

Regular Expression Details

Title Test Find URL parameter matching
Expression
[?&]([^&#=]+)(?:=([^&#]*))?
Description
Matches parameters in an URL's query part. The parameters' name and value will be available as subsrting $1 and $2. $2 will be empty if the value is empty (e.g. "…&param=&…") or undefined if there's no equals to sign (e.g. "…&param&…").
Matches
http://example.com/?param=value&emptyParam=&undefinedParam#anchor | https://www.google.com/imghp?hl=en&tab=wi | http://www.youtube.com/results?search_type=videos&search_query=Regular+Expressions&uni=3
Non-Matches
http://example.com/#anchor | http://www.google.com/ | URL's with no GET parameters
Author Rating: Not yet rated. AndreasSE93
Source
Your Rating
Bad Good

Enter New Comment

Title

Name

Comment

Spammers suck - we apologize. Please enter the text shown below to enable your comment (not case sensitive - try as many times as you need to if the first ones are too hard):

Existing User Comments

Copyright © 2001-2025, RegexAdvice.com | ASP.NET Tutorials