[osis-core] Regex syntax proposal and question

Patrick Durusau osis-core@bibletechnologieswg.org
Tue, 02 Jul 2002 09:16:42 -0400


Harry,

Harry Plantinga wrote:

>><xs:simpleType name="osisRef">
>>	<xs:restriction base="xs:string">
>>		<xs:pattern
>>value="(([^\s]*\.){0,6}([^\s]*))(@((cp:(\d*)(\+(\d*))?\((.*)\))|((
>>x-(\c*):)(.*)\((.*)\))))?((-(([^\s]*\.){0,6}([^\s]*)))?|(-(([^\s]*
>>\.){0,6}([^\s]*)))(@((char:(\d*)\+(\d*)\((.*)\))|((x-(\c*):)(.*)\(
>>(.*)\))))?)?"/>
>>	</xs:restriction>
>></xs:simpleType>
>>
>
>You probably don't want to use [\s]* for a token.  That would allow
>characters like @, (, . in tokens.
>
So you would propose [\c]* (removing the negation from ^\s)? (Allows all 
valid XML name characters)


>
>>As modified per Steve's last post on its syntax (char changed to cp,
>>made range optional (warning, on-the-fly editing).
>>
>
>Also, I think Steve said he like the idea of searching forward from
>the cp location to the start of the string match.
>
Not sure what you saying here in terms of changing the regex syntax, 
proposed syntax follows, can you edit to illustrate?

<xs:pattern 
value="(([\c]*\.){0,6}([\c]*))(@((cp:(\d*)(\+(\d*))?\((.*)\))|((x-(\c*):)(.*)\((.*)\))))?((-(([\c]*\.){0,6}([\c]*)))?|(-(([\c]*\.){0,6}([\c]*)))(@((char:(\d*)\+(\d*)\((.*)\))|((x-(\c*):)(.*)\((.*)\))))?)?"/>

Patrick

-- 
Patrick Durusau
Director of Research and Development
Society of Biblical Literature
pdurusau@emory.edu