Jump to content

Most complex regular expressions you've seen/dealt with?


Zurev

Recommended Posts

Let's have it!

 

This is the most complex one I was able to find by google:

http://ex-parrot.com/~pdw/Mail-RFC822-Address.html

 

However I'd rather most complex that are practical  :P

 

Here's an interesting one, validates dates from the year 1600-9999 including leap years in a mm/dd/yyyy format:

~^(((0[1-9]|[12]\d|3[01])\/(0[13578]|1[02])\/((19|[2-9]\d)\d{2}))|((0[1-9]|[12]\d|30)\/(0[13456789]|1[012])\/((19|
[2-9]\d)\d{2}))|((0[1-9]|1\d|2[0-8])\/02\/((19|[2-9]\d)\d{2}))|(29\/02\/((1[6-9]|[2-9]\d)(0[48]|[2468][048]|[13579][26])|((16|[2468][048]|[3579][26])00))))$~

 

Anyway, let's see what you've got!

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.