in reply to Advanced techniques with regex quantifiers
This is the very issue I was trying to get at recently with my initiatory node validate variable-length lines in one regex?, especially part B. Approach 1 (A or B) is what I was trying to avoid (and, in the end, have had to resort to anyway as this project lacks the time for me to work up any cleverness against it); approach 2 is what I thought might exist and I'm very glad for this exposition; approach 3A seems very excellent and it'll be many projects before I'll have the fluency to attempt anything of the kind.
What my problem had gotten me curious about though was the deeper and much less useful question of whether, in principle, "pure" regex can handle these situations -- whatever "pure" might mean. Solutions 2A and 2B are disqualified because including perl code (or I think any sort of eval?) injects an additional rules-world, patching the incompleteness. I lack the theory to figure out whether 3A's Advanced Features Regex counts as what I'm talking about. I scarcely have the theory to know what I'm talking about.
Everyone else might not care about this; it just brings out the sophomore in me, is all. Seems as though I should look into that Regexp::Grammars. Anyway, thanks very much, smls; I like it.
|
|---|