[x3d-public] X3D regular expression (regex) improvements
Don Brutzman
brutzman at nps.edu
Sun Aug 19 22:02:37 PDT 2018
Thanks for noticing the \ omission on the negative lookahead examples - now fixed. The other uses of . in regex patterns were all escaped as \. correctly.
On 8/17/2018 1:36 PM, Leonard Daly wrote:
> Just a single note and a question.
>
> [most of message stripped away...]
>
>
>> It is great when we find those patterns, am trying to keep things maintainable. The color-coding on web page definitely helps.
>>
>> Negative lookahead is good for avoiding illegal values, but not allowed in XML Schema (probably to avoid computational denial of service attacks_. Have listed a pattern nevertheless, other languages/tools might want to use it.
>>
>> ==================
>> Disallowed values:
>>
>> * Negative lookahead filters can disqualify attributes that contain illegal values.
>> * W3C Recommendation for XML Schema (XSD) unfortunately does not support this construct.
>> * (?!((0|0.0*|.0+)\s+){3}) prohibits 0 0 0 since zero vector is illegal as initial axis triplet of an SFRotation.
>
> As I read the above
>
> If not
> (0 or 0.0* or .0+
> repeated white-space character
> ) three times
>
> You should escape the "dot"s; otherwise, it accepts any character (the dots are meta-character when not in a character class)
>
> This would be:
>
> (?!((0|0\.0*|\.0+)\s+){3})
>
>
> See https://regex101.com/ to test and explain the regex.
>
>
> Is there any consideration for internationalization of number display. Most of Europe uses "," (comma) as the radix character (decimal separator). [See https://docs.oracle.com/cd/E19455-01/806-0169/overview-9/index.html]
>
>
>
> --
> *Leonard Daly*
> 3D Systems & Cloud Consultant
> LA ACM SIGGRAPH Past Chair
> President, Daly Realism - /Creating the Future/
>
>
> _______________________________________________
> x3d-public mailing list
> x3d-public at web3d.org
> http://web3d.org/mailman/listinfo/x3d-public_web3d.org
>
all the best, Don
--
Don Brutzman Naval Postgraduate School, Code USW/Br brutzman at nps.edu
Watkins 270, MOVES Institute, Monterey CA 93943-5000 USA +1.831.656.2149
X3D graphics, virtual worlds, navy robotics http://faculty.nps.edu/brutzman
More information about the x3d-public
mailing list