On Thu, Jun 19, 2008 at 3:12 PM, Justin To <tekmc / hotmail.com> wrote:
> I'm stuck trying to write a regular expression for a percentage:
>
> Examples of what I'm trying to match:
>
> 1.1, 1.12, 12, 12.1 and 12.12
>
> 0.00 <= float <= 100.00

this seems to work:

/^(100(\.0{1,2})?|(\d{1,2})?(\.\d{1,2})?)$/

martin