User:Rich Farmbrough/regexes

E & OE

See also: User:Rich Farmbrough/diacritics See also: User:Rich Farmbrough/AWB/Reg ex

ISO-ish dates
\b{?:(\d\d\d\d}([- /.])(?:(0[13-9]|1[012])\2(0[1-9]|[12][0-9]|30)|(0[13-9]|1[012])\2(0[1-9]|[12][0-9]|30)|(0[13578]|10|12)\2(31)|(02)\2(0[1-9]|[12][0-8]))|([02468][048]00|[13579][26]00|\d\d(?:[02468][48]|[2468]0|[13579][246]))([- /.])(02)\2(29)) any year any month except February any date up to 30 Any year months with 31 days Any year days up to 28 February leap years - February 29
 * needs testing
 * components
 * \d\d\d\d([- /.])(0[13-9]|1[012])\2(0[1-9]|[12][0-9]|30)
 * \d\d\d\d([- /.])(0[13578]|10|12)\2(31)
 * \d\d\d\d([- /.])(02)\2(0[1-9]|[12][0-8])
 * ([02468][048]00|[13579][26]00|\d\d(?:[02468][48]|[2468]0|[13579][246]))([- /.])(02)\2(29)

Days of the week
\b(Mon|Tues|Wednes|Thurs|Fri|Sat|Sun)day\b

\b(Mon|Tue|Wed|Thu|Fri|Sat|Sun)\b

Months of the year
\b(January|February|March|April|May|June|July|August|September|October|November|December)\b

\b(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\b

\b(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Sept|Oct|Nov|Dec)\b

Date-like titles
(^\d* BC$)|(^\d*$)|\d\d\d in|decade|\d\d\ds|in \d\d\d|of \d\d\d|(January|February|March|April|May|June|July|August|September|October|November|December)

State abbreviations
\b(A[LKRZ]|C[OT]|D[EC]|FL|GA|HI|I[ADLN]|K[SY]|M[ADEINOST]|N[DEHJMVY]|O[HKR]|PA|RI|S[CD]|T[NX]|UT|V[AT]|W[AIVY])\b

\b(AS|GU|MP|PR|VI|FM|MH|PW|CZ|PI|TT|CM)\b
 * Territories etc

Mismatched headers
\n((==+)[^=\n]*\1=+|(==+)=+[^=\n]*\1)\s*\n