Regex to match a 2-digit number or a 3 digit number
<p>I need to be able to check if a string contains either a 2 digit or a 4 digit number before a <code>.</code> (period).</p>

<p>For example, <code>39.</code> is good, and so is <code>3926.</code>, but <code>392.</code> is not.</p>

<p>I originally had <code>(^\\d{2,4).$)</code> but that allows between a 2 and a 4 digit number preceding a period.</p>

<p>I also tried <code>(^\\d{2}.|\\d{4}.$)</code> but that didn't work.</p>