[osflash] RegExp question

John Grden neoriley at gmail.com
Wed Jun 6 21:38:49 EDT 2007


Nevermind - got it:

/^\b(\d{2})\b[
]\b(?:(?:[0-9]|1[0-2])\b[.:]\b[0-5]\d(?:\D?[ap][m])|(?:[01]*\d|2[0-3])\b[.:]\b[0-5]\d)\b$/i;

See, I need to ask early in the day, because then I'll just figure it out
earlier ;)  That's what I get for copying code.  Writing it from scratch =
worky

thanks anyway!

On 6/6/07, John Grden <neoriley at gmail.com> wrote:
>
> Can someone tell me WHY this is not returning false?
>
> it's supposed to catch a "yy hh:mm" string, but when I pass 4 digit year,
> it still says true.  It also optionally allows for 12hr clock values  (hence
> the alternation with the am/pm)
>
> var reg:RegExp = /^\b(\d{2})\b[
> ]\b(?:(?:0?[1-9]|1[012])(?:[.:][0-5]\d){1,2}(?:\D?[ap][m]))|(?:[01]*\d|2[0-3])\b[.:]\b[0-5]\d\b$/i;
>
> trace(reg.test("1969 21:00"));
>
> any and all help mucho appreciated!
>
> --
> [  JPG  ]




-- 
[  JPG  ]
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://osflash.org/pipermail/osflash_osflash.org/attachments/20070606/e76cb0ec/attachment.htm


More information about the osflash mailing list