sdmx3mdt / public-consultation

0 stars 0 forks source link

Improve RegEx for SemanticVersionReferenceType #22

Closed dosse closed 2 years ago

dosse commented 3 years ago

Instead of ((0|[1-9]\d*)\+?)(\.((0|[1-9]\d*)\+?)){2} I would proposing using: (^(0|[1-9]\d*)\+\.(0|[1-9]\d*)\.(0|[1-9]\d*)$)|(^(0|[1-9]\d*)\.(0|[1-9]\d*)\+\.(0|[1-9]\d*)$)|(^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)\+$).

The longer but more precise RegEx only allows for the wildcarding of one of the major, minor, or patch version parts using '+'. The description of that type should actually be updated in this sense.

sdmx3mdt commented 3 years ago

16 June 2021 TWG / SWG public consultation public review meeting Decision: agreement that this change should be made in the XML schemas subject to advise from J Gager on the technical feasibility and generally whether it's sensible. Action: J Gager to advise

sdmx3mdt commented 2 years ago

J Gager advice: In XML schema, you can specify multiple patterns. This accomplishes the goal and is easier to understand in my opinion: `

</xs:restriction>`

@dosse do you agree?

dosse commented 2 years ago

@sdmx3mdt Yes, it's fine as long as it corrects the current issue of possible multiple version wildcards. Please use the format that you see fits best in the context of xml.

sdmx3mdt commented 2 years ago

Fixed in release candidate working branch https://github.com/sdmx3mdt/sdmx-ml/tree/develop