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

Please support RegExLib Sponsors

Sponsors

Expressions by User

   Displaying page 1 of 1 pages; Items 1 to 1
Title Test Details 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
   Displaying page 1 of 1 pages; Items 1 to 1

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