Re: IPv6 address parsing
Seth <[email protected]>
| Newsgroups | gmane.comp.parsers.spirit.general |
|---|---|
| Message-ID | <[email protected]> |
On 17-12-17 16:42, Michael Powell wrote: > i.e. repeat(1, 4)[hex] SHOULD reject "abcd1234" but it is not. Of course it SHOULD not. If you want that, program it. We've been over this many times before: On 08-12-17 16:53, Seth wrote: > On 04-12-17 23:09, Michael Powell wrote: >> I should think that if there were any remaining input that would be a >> failure to match? > You shouldn't. PEG grammars are left-to-right greedy. This is documented. > > I've said this before: > > On 30-11-17 00:40, Seth wrote: >> Bonus tip: consider adding `>> qi::eoi` at the end of the parse >> expression so you don't need to check whether all of the input has been >> consumed (it must). > And also this warning about partially matching: > > On 27-11-17 13:51, Seth wrote: >> A more complete example: >> >> https://stackoverflow.com/questions/47243884/boost-spirit-qi-validating-input-parser/47244585#47244585 >> >> Which makes the point that you might want to `lexeme [ >> uint_parser<uint16_t, 10, 2, 5>() >> !(digit|'.') ]` to avoid >> partially matching longer numbers. ------------------------------------------------------------------------------ Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot