Technically speaking, if we want to properly match any archetype in a slot, we need a regex that will match any level of versioning id. Since matched archetypes will eventually all have 3-part versions (but today might have only 1-part versions), we need to match thngs like

.v0
.v1
.v0.0.1
.v3.0.2

and so on. So Diego's expression will do that. But Sebastian is correct - some of the matched archetypes could be test or research archetypes. So you need the remaining bit as well. You could in theory use:

v[0-9]+(\.[0-9]+(\.[0-9]+((-rc|-alpha)(\.[0-9]+)?)?)?)?
but I would say it is overkill (you only use regexes like that when you think there could be garbage version ids and you want to catch them and reject them). A reasonable balance is probably something like

\.v[0-9]+.*

which forces at least one digit of major version, and allows anything at all to come after, which is reasonable if we assume that no tools will create completely invalid version ids.

For reference, there are some useful regexes here <https://github.com/openEHR/adl-tools/blob/master/libraries/openehr/src/am/archetype/archetype_hrid.e>.

- thomas

On 22/07/2015 15:26, Sebastian Garde wrote:
My understanding was that minor version and patch version would not be part of the normal archetype id, which is what you are looking for here?
Otherwise you'd need to allow "-alpha" etc here as well?

Sebastian

_______________________________________________
openEHR-technical mailing list
[email protected]
http://lists.openehr.org/mailman/listinfo/openehr-technical_lists.openehr.org

Reply via email to