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 3
Title Test Details Social Security Number - All Rules Enforced
Expression
^((?!000)(?!666)(?:[0-6]\d{2}|7[0-2][0-9]|73[0-3]|7[5-6][0-9]|77[0-2]))-((?!00)\d{2})-((?!0000)\d{4})$
Description
Could not find a regex that truly matched the rules here http://en.wikipedia.org/wiki/Social_Security_number#Valid_SSNs So I modified an existing one to match the valid SSN rules. The first digit set will not match: 000, 666, 734 to 749, and greater than 772. * Numbers with all zeros in any digit group (000-xx-####, ###-00-####, ###-xx-0000)
Matches
455-55-4444|333-22-1111|733-11-1111
Non-Matches
734-11-1111|749-11-1111|772-11-1111
Author Rating: The rating for this expression. Tim Cartwright
Title Test Details Querystring Parse
Expression
(?<=[\?|\&])(?<key>[^\?=\&\#]+)=?(?<value>[^\?=\&\#]*)
Description
I wrote this to parse the querystring into its key value parts. It will also match querystring keys without an associated value. For a nice url parser, look at this one http://regexlib.com/REDetails.aspx?regexp_id=628
Matches
http://www.foo.com/page.aspx?qs1=true&test=foo&bar=true&test#blah
Non-Matches
http://www.foo.com/page.aspx
Author Rating: The rating for this expression. Tim Cartwright
Title Test Details Head Parser
Expression
(<meta [.\w\W]*?\>)|(<style [.\w\W]*?</style>)|(<link [.\w\W]*?\>)|(<script [.\w\W]*?</script>)
Description
Parses the objects out from an html header. These objects are: meta, style, link, and script. Use with the multiline option to pull from multine scripts and styles.
Matches
<head runat="server"> <title></title> <script type="text/javascript"> // // function foo() { } // </script> <style type="text/css"> /* ** ** */ .foo { font-size : large;} </style> <script src="includes/JScript1.js" type="text/javascript"></script> <link href="includes/Stylesheet1.css" rel="stylesheet" type="text/css" /> <script type="text/javascript"> // // function foo2() { } // </script> <style type="text/css"> /* **
Non-Matches
Um....
Author Rating: Not yet rated. Tim Cartwright
   Displaying page 1 of 1 pages; Items 1 to 3

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