Re: TMCL Regexp constraint

Robert Cerny <[email protected]>
Newsgroups gmane.text.xml.xtm.general
Message-ID <[email protected]>
Am 18.11.2010 um 21:59 schrieb Lars Marius Garshol:

> * Robert Cerny
>>
>> I am wondering how the TMCL Regular Expression constraint [1]  
>> should be applied:
>>
>> a. the boundaries are implicit
>> b. the boundaries are explicit
>>
>> E.g. i want all lower case characters in my string:
>>
>> Should the value of the respective occurrence of the topic that  
>> represents my regexp constraint be:
>> a. [a-z]+
>> b. ^[a-z]+$
>
> Very good question. Unfortunately, the answer to your question has  
> been well hidden. What it means to match a regular expression is  
> defined here:
>
> http://www.isotopicmaps.org/tmcl/tmcl.html#d0e539
>
> Following the links you get to:
>   http://www.w3.org/TR/2004/REC-xmlschema-2-20041028/#regexs
>
> which says:
>
>> Unlike some popular regular expression languages (including those  
>> defined by Perl and standard Unix utilities), the regular  
>> expression language defined here implicitly anchors all regular  
>> expressions at the head and tail, as the most common use of  
>> regular expressions in ·pattern· is to match entire literals.
>
> So the answer to your question is (b), which IMHO is as it should be.

Thanks for leading the way to the well hidden answer. I agree that it  
should be that way. But i must admit the example threw me off and  
would suggest a change so that it becomes clearer. The current  
example matches any string which *contains* a phone number. I think a  
better example would be any string that *is* a phone number.

Best,

Robert
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.