On Feb 5, 9:29 pm, Michael <mich...@vermontsnows.com> wrote:
> Thank you all - Kangax's low profile technique works like a champ.
>
> Walter Lee: Regular expressions hurt my head. I will get there one
> day.
>
> The actual thing I am working on take about 100 alpha/numeric
> sequences of no real logical order... so making it in regular
> expression would take far longer (for me) then juts stubbing the 100
> sequences in there.
>
In Perl, I would not use regular expressions for this at all, but a
hash:
(equivalent of)
var hash = {V30000: true, B47242:true, V54000:true};
function checkValid(value)
{
return hash[value];
}
(or 'return hash[value] == true' if you're picky).
This is a good idea in Perl because the language is optimised for
accessing hash values: I don't know how true that is in javascript.
Colin
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Prototype & script.aculo.us" group.
To post to this group, send email to prototype-scriptaculous@googlegroups.com
To unsubscribe from this group, send email to
prototype-scriptaculous+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~----------~----~----~----~------~----~------~--~---