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 6
Title Test Details URI with Scheme, Path, Query, and Fragment
Expression
(?m)^(?<scheme>\w+?://)?(?<path>(?:[\w.%$\-_+!*'(),=@]+\/|\b)+(?:[\w.%$\-_+!*'(),=@]*))(?<query>\?(?:[\w.%$\-_+!*'(),=@]+=[\w.%$\-_+!*'(),=@]*&?)*)?(?<fragment>#[\w\.%$\-_+!*'(),=@]*)?
Description
Identifies scheme, path, query, and fragment in any URI, putting them into named groups. All groups are optional except path.
Matches
http://regexlib.com/
Non-Matches
~~~~
Author Rating: Not yet rated. Kevin Spencer
Title Test Details TR Content
Expression
(?s)<tr[^>]*>(?<content>.*?)</tr>
Description
Matches complete table rows (<tr>...</tr>) and puts everything between the tr tags into a group named "content".
Matches
<tr><td>abc</td></tr>
Non-Matches
<tr><td>abc</td>
Author Rating: Not yet rated. Kevin Spencer
Title Test Details Query String Parameters
Expression
[\?&](?<name>[^&=]+)=(?<value>[^&=]+)
Description
Matches name/value pairs in HTTP Query Strings, placing name into group named "name" and value into group named "value"
Matches
http://regexlib.com/?a=b&c=d
Non-Matches
http://regexlib.com/
Author Rating: Not yet rated. Kevin Spencer
Title Test Details METAR Report
Expression
(?i)^(?:(?:METAR|SPECI)\s*)*(?<ICAO>[\w]{4})\s*?(?<DateUTC>(?<DayOfMonth>\d{0,2})(?<Hour>\d{2})(?<Minutes>\d{2}))Z{1}\s*(?:[^\r\n])*
Description
Matches any legitimate METAR (Meterological Weather Report) string, and places parts into named groups, "ICAO", "DateUTC", "DayOfMonth", "Hour", "Minutes"
Matches
METAR KORF 310951Z 21004KT 10SM CLR 17/16 A3018
Non-Matches
310951Z 21004KT 10SM CLR 17/16 A3018
Author Rating: Not yet rated. Kevin Spencer
Title Test Details HTML href
Expression
(?i)(?s)<a[^>]+?href="?(?<url>[^"]+)"?>(?<innerHtml>.+?)</a\s*>
Description
Matches a complete HTML href tag, placing the URL into a group named "url" and the innerHTML into a group named "innerHtml"
Matches
<a href="http://regexplib.com">Inner <span>html</span></a>
Non-Matches
<a href="http://regexplib.com">
Author Rating: The rating for this expression. Kevin Spencer
Title Test Details Hyperlink attributes
Expression
(?s)(?<=<a[^>]+?)(?<name>\w+)=(?:["']?(?<value>[^"'>]*)["']?)(?=.+?>)
Description
Captures all attributes in HTML anchor tags, putting them into groups named "name" and "value"
Matches
<a class='foo' href="http://regexplib.com">
Non-Matches
<p align="center">&nbsp;</p>
Author Rating: Not yet rated. Kevin Spencer
   Displaying page 1 of 1 pages; Items 1 to 6

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