Regular Expressions 101

Community Patterns

Community Library Entry

1

Regular Expression
Created·2015-07-22 00:16
Flavor·JavaScript

/
^(?=^20)(?=(?:.{5}|.{7}))
/
Open regex in editor

Description

Length of 5 or 7.

if 7, it should start with 20.

Submitted by Chris Roe