Ineffective pattern for CURIE

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Ineffective pattern for CURIE

Brian M. Ames-2
The pattern given for CURIE in
http://www.w3.org/TR/2010/NOTE-curie-20101216 is ineffective for
validation since it matches anything but an empty string. That is to say
(([\i-[:]][\c-[:]]*)?:)?.+ is no different than .+ alone. An alternative
would be (([\i-[:]][\c-[:]]*)?:).+|([^:])+ which would require any CURIE
without a prefix but containing a colon to be prefixed with a colon
delimiter.
Example
a:1:more:time
:1:more:time
1 more time
would all be valid but
1:more:time
would not be.

--
Best regards,

Brian M. Ames
http://www.ameshymn.org



Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Ineffective pattern for CURIE

Shane McCarron
I recommend you look at http://www.w3.org/TR/rdfa-core - there is a
better pattern for CURIE in there.  It is the current best definition of
CURIE.

On 5/9/2012 10:25 PM, Brian M. Ames wrote:

> The pattern given for CURIE in
> http://www.w3.org/TR/2010/NOTE-curie-20101216 is ineffective for
> validation since it matches anything but an empty string. That is to
> say (([\i-[:]][\c-[:]]*)?:)?.+ is no different than .+ alone. An
> alternative would be (([\i-[:]][\c-[:]]*)?:).+|([^:])+ which would
> require any CURIE without a prefix but containing a colon to be
> prefixed with a colon delimiter.
> Example
> a:1:more:time
> :1:more:time
> 1 more time
> would all be valid but
> 1:more:time
> would not be.
>

--
Shane McCarron
Managing Director, Applied Testing and Technology, Inc.
+1 763 786 8160 x120


Loading...