in reply to validate variable-length lines in one regex?
I don’t readily think so ... although, “this being Perl, I’m sure it can be done.” Most of what would concern me, in addition to the potential complexity, is also the notion of coupling between the various alternatives. You want to be able to change this thing easily ... to add new “stinkin’ input files” without stinking-up the old ones. ;-)
One idea that comes to mind is to build-up the process, maybe as a list of (anonymous?) subs, or maybe as very-repetitive subs which call other ones (e.g. “until one of them returns false.”) Each of those subroutines would match against a particular regex. (The reason why I didn’t suggest a list of qr// regexes is that you might well need to do “slightly more” in one-or-another of those subroutines . . .)
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: validate variable-length lines in one regex?
by uhClem (Scribe) on Jul 06, 2015 at 18:39 UTC | |
by locked_user sundialsvc4 (Abbot) on Jul 07, 2015 at 00:58 UTC |