in reply to Re^2: validate variable-length lines in one regex?
in thread validate variable-length lines in one regex?
I, too, am interested. I agree, based on this further explanation, that my original suggestion of subs could become unmanageable in the use-case that you describe. I graciously withdraw my suggestion . . .
The notion of building a Regex, as BrowserUK originally suggests below and as poj took and ran-with a little later on, is probably the right balance between readability and flexibility. (All now liberally sprinkled with up-vote pixie-dust...)