[x3d-public] X3D regular expression (regex) improvements
Leonard Daly
Leonard.Daly at realism.com
Fri Aug 17 13:36:19 PDT 2018
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/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://web3d.org/pipermail/x3d-public_web3d.org/attachments/20180817/497ca72c/attachment.html>
More information about the x3d-public
mailing list