this is my idea https://github.com/aleivag/pyparsing/pull/1/commits/6e3e704f46ef2b7b0126380c8d0957a5188a087d
I think this is a bug, but it may be intended behaivure, just dont seems right o me (by the way love pyparsing!!!). concider opt1 and opt2, defined as follow: from pyparsing import Literal, pyparsing_common ipv6 = (Literal('[') + pyparsing_common.ipv6_address + Literal(']')) ipv4 = pyparsing_common.ipv4_address opt1 = ipv6.setResultsName('ip') opt2 = (ipv4 | ipv6).setResultsName('ip') print(opt1.parseString('[::1]').get('ip')) print(opt2.parseString('[::1]').get('ip')) Both cases should print the...
I think this is a bug, but it may be intended behaivure, just dont seems right o me (by the way love pyparsing!!!). concider opt1 and opt2, defined as follow: from pyparsing import Literal, pyparsing_common ipv6 = (Literal('[') + pyparsing_common.ipv6_address + Literal(']')) ipv4 = pyparsing_common.ipv4_address opt1 = ipv6.setResultsName('ip') opt2 = (ipv4 | ipv6).setResultsName('ip') print(opt1.parseString('[::1]').get('ip')) print(opt2.parseString('[::1]').get('ip')) Both cases should print the...