While these regex libraries are useful, I don't think I can fold them directly into a Marpa DSL definiton. From what I can tell, I can only use individial character classes, and would have to comprise a number of lexeme tokens to match the relative complexity of the IPv4 (and especially IPv6) expressions.
In my more-specific application, I am indeed intending to validate the IPs externally -- probably with Net::IP. To that end, I may well alter the DSL just to accept NAME, and lay off the exact semantics to a subroutine with an if (is_ip4(...) { ... } elsif (is_ip6(...) { ... } else { assume_hostname(...) } flavour.
Thanks for looking in...
J.
|