Re: Release 1.0.2 change - SPEC-260 - Correct theregex publishedforthe A
Peter Gummer wrote:
> Thomas Beale wrote:
>
>
>> archetype_id: qualified_rm_entity ‘.’ domain_concept ‘.’ version_id
>>
>> qualified_rm_entity: rm_originator ‘-’ rm_name ‘-’ rm_entity
>> rm_originator: V_NAME
>> rm_name: V_NAME
>> rm_entity: V_NAME
>>
>> domain_concept: concept_name { ‘-’ specialisation }
>> concept_name: V_NAME
>> specialisation: V_NAME
>>
>> version_id: ‘v’ V_NONZERO_DIGIT [ V_NUMBER ] [ ‘.’ V_NUMBER [ ‘.’
>> V_NUMBER ] ]
>>
>> V_NONZERO_DIGIT: [1-9]
>> V_DIGIT: [0-9]
>> V_NUMBER: [0-9]*
>> V_NAME: [a-zA-Z][a-zA-Z0-9_]+
>>
>>
>> The PERL regular expression equivalent of the above is as follows:
>> [a-zA-Z]\w+(-[a-zA-Z]\w+){2}\.[a-zA-Z]\w+(-[a-zA-Z]\w+)*\.v[1-9]\d*(\.\d+){0,2}
>>
>
>
> This all looks correct to me now, Thomas, except for the version_id
> production rule:
>
> ‘v’ V_NONZERO_DIGIT [ V_NUMBER ] [ ‘.’ V_NUMBER [ ‘.’ V_NUMBER ] ]
>
> I considered but rejected this idea, because it permits amputated
> version
> numbers such as these:
>
> v1.
> v1..
> v1..1
> v1.1.
>
> I abandoned the "V_NUMBER" idea because it allows the two optional
> suffixes
> to have no digits! You could of course fix that by redefining
> V_NUMBER like
> so:
>
> V_NUMBER: [0-9]+
>
> But then it would force you to start with a two-digit version number.
> v1, v2
> through to v9 would all be illegal versions. Not good!
>
>
*The following permits v1, etc, since in **V_NONZERO_DIGIT [ V_NUMBER ]
the latter part is optional.*
*
version_id: ‘v’ V_NONZERO_DIGIT [ V_NUMBER ] [ ‘.’ V_NUMBER [ ‘.’
V_NUMBER ] ]
V_NONZERO_DIGIT: [1-9]
V_NUMBER: [0-9]+
* - thomas
_______________________________________________
openEHR-technical mailing list
openEHR-technical@openehr.org
http://lists.chime.ucl.ac.uk/mailman/listinfo/openehr-technical