http://qs321.pair.com?node_id=152544


in reply to •Homework alert! Re: validating string length with a regular expression
in thread validating string length with a regular expression

<wild speculation>

Although it's not my question, I can imagine a situation where someone is validating a set of variables which contain user-supplied data. A simple design for validating them might involve a hash table which correlates each data type to an "allowable" regex pattern.

Not that there aren't ways around this (perhaps using subroutines instead of regexes). But I'll admit that I've done it before, cramming a lot of data validation into a single regex for this purpose.

</wild speculation>

Update: I'm good. But I'm slow. Ah, well...

buckaduck