<#Frame>

<#WOString var:value="name"/>

<#if var:value="error">
<#get var:value="error" />
<#WEFormToRemote id="form" fragment="matchresult" @action="evalRegEx" method="POST" > <#WOTextField idname="value" var:value="value" size="40" /> (Value)
<#WOTextField idname="regex" var:value="regex" size="40" /> (Regex)
<#WOSubmitButton idname="ok" value="match" />
<#WOFragment name="matchresult" elementName="div"> Value: <#get var:value="value" />
RegEx: <#get var:value="regex" />
<#if var:condition="didMatch" value="OK"> DID MATCH <#if var:condition="didMatch" value="FAIL"> did NOT match

CheatSheet

\d{2,4} - digits, at least 2, max 4

a?     - match 0 or 1 times     (aka a{0, 1} ?)
a*     - match 0 or more times  (aka a{0,} ?)
a+     - match 1 or more times  (aka a{1,} ?)
a{n,m} - match at least n, but no more than m times
a{n,}  - match at least n or more times
a{n}   - match exactly n times

OR (|):
$year = /\d{4}|\d{2}/;		(1999 and 99, but not 199)