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 2
Title Test Details RFC 2822 Date Regex
Expression
^(?:\s*(Sun|Mon|Tue|Wed|Thu|Fri|Sat),\s*)?(0?[1-9]|[1-2][0-9]|3[01])\s+(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s+(19[0-9]{2}|[2-9][0-9]{3}|[0-9]{2})\s+(2[0-3]|[0-1][0-9]):([0-5][0-9])(?::(60|[0-5][0-9]))?\s+([-\+][0-9]{2}[0-5][0-9]|(?:UT|GMT|(?:E|C|M|P)(?:ST|DT)|[A-IK-Z]))(\s*\((\\\(|\\\)|(?<=[^\\])\((?<C>)|(?<=[^\\])\)(?<-C>)|[^\(\)]*)*(?(C)(?!))\))*\s*$
Description
This is the best RFC 2822 ( http://www.faqs.org/rfcs/rfc2822 ) date format regular expression I could come up with. I've tested it, not very extensively though. This regex also validates obsolete standard, excluding comments anywhere.
Matches
Thu, 6 Jan 2005 18:44:56 -0500 | Thu, 21 Dec 2000 16:01:07 +0200 (\(proper\) & (nested) comment)
Non-Matches
Thu, 0 Jan 1856 18: 44:56 -0500 | Thu, 21 Dec 2000 16:01:07 +0200 (\(improper) comment) | blah
Author Rating: The rating for this expression. Ivik Injerd
Title Test Details PHP Function Regex
Expression
^\s*\w+\s*\((\s*(("|')([^\3]+|\\\3)\3|\$?[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]|[0-9]*)\s*,?)*\s*\)
Description
I needed a regex to parse PHP functions, so I made it and here it is. It will not validate with array variables as the function arguments.
Matches
myfunction('string', "another", 123 ,$var2, CONSTANT )
Non-Matches
my=function('str'ing', $1var, 133t,$array[2] )
Author Rating: The rating for this expression. Ivik Injerd
   Displaying page 1 of 1 pages; Items 1 to 2

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