[x3d-public] X3D regular expression (regex) improvements: scientific notation on bboxSize -1 -1 -1 sentinel values

Don Brutzman brutzman at nps.edu
Tue Aug 21 06:10:13 PDT 2018


On 8/20/2018 7:43 AM, Andreas Plesch wrote:
> Hi Don,
> 
> What I was suggesting, was multiple patterns for a single simple type,
> more below.
> 
[...]

once again very interesting, will investigate further.

even if XML Schema won't apply both in series, as long as it doesn't fail by having the negative-lookahead secondary check then is probably worth including somehow so that other tools can use the more restrictive pattern.

regex101 and java should allow the more thorough testing.  we'll see if it is poissible.

>> As it so happens, this weekend I cleaned up the expression for bboxSize type.  Also added it to X3DUOM and X3DJSAIL.  The regex can be found as part of the base type SFVec3fObject.
>>
>>          X3D Regular Expressions (regexes): bboxSize
>>          http://www.web3d.org/specifications/X3dRegularExpressions.html#bboxSize
>>
>> Online unit tests:
>>          https://regex101.com/r/sjaPZq/1
> 
> Should -1e1 -1 -1, or
> 
> -1e0 -1 -1 or
> 
> -0.1e2 -1 -1
> 
> be allowed as well ? Currently the regex does not match these. It is
> unlikely that anybody would want to do that but it may be legal.
> 
> -Andreas

good catch.  since the -1 -1 -1 sentinel value might be autogenerated by a tool which happens to use scientific notation, it seems like we should allow such legal values if encountered.

i was able to adjust the pattern and unit tests to support.  test case -1+e00 -1e00 -1e-00

unit testing satisfactory, change checked in and uploading. as before just experimenting with x3d-4.0.xsd schema to avoid possible impact with production scenes.  thanks!

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