<div dir="ltr">Can someone explain this regular expression for the osisRef grains?<br><br><span style="font-family: courier new,monospace;">(@(cp\[(\p{Nd})*\]|s\[(\p{L}|\p{N})+\](\[(\p{N})+\])?))?</span><br><br>The OSIS manual says that a grain is in the form of:<br>
<br><blockquote style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;" class="gmail_quote">grainType(parameters) <br></blockquote><br>And provides the example:<br><br><blockquote style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;" class="gmail_quote">
Matt.1.1@cp(3)-Matt.1.1@cp(12) <br></blockquote><div><br>But elsewhere the format is shown to be:<br><br><blockquote style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;" class="gmail_quote">
Gen.1.1@cp[8]<br></blockquote><div><br>I'm assuming that the parentheses are wrong, and the square brackets are right.<br><br>Furthermore, looking at the cp grain: <span style="font-family: courier new,monospace;">cp\[(\p{Nd})*\]</span><br>
<br>Why does it allow zero or more digits to be supplied as the parameter and not one or more? i.e. <span style="font-family: courier new,monospace;">cp\[(\p{Nd})+\]</span>. Otherwise I could do John.3@cp[] and I don't think that should be allowed.<br>
<br>Now for the s grain: <span style="font-family: courier new,monospace;">s\[(\p{L}|\p{N})+\](\[(\p{N})+\])?</span><br><br>I can see that that it is similar to cp, but that the parameter can be not just a decimal digit but any unicode number or letter. What I don't get is what comes after this, namely: <span style="font-family: courier new,monospace;">(\[(\p{N})+\])?</span> What's with this secondary square-bracket-enclosed Unicode number? The s grain regular expression would allow something like this: s[John][12], but there's no example of this in the manual. Is this supposed to mean that it would select the 12th instance of "John"?<br>
<br>Thanks!<br>Weston<br></div></div></div>