[x3d-public] X3D regular expression (regex) improvements

Don Brutzman brutzman at nps.edu
Sat Aug 4 09:56:25 PDT 2018


On 7/30/2018 2:58 PM, Andreas Plesch wrote:
> I added a few decimal point tests for SFFloat here:
> 
> https://regex101.com/r/RMeNmE/3/tests
> 
> Should .3 (meaning 0.3) be allowed ? It is in most contexts.
> 
> Cheers,
> 
> -Andreas

This is a very important catch.  Yes it should be allowed, and changes the regex pattern for floats to allow no-leading-digit form in the regex pattern.

Alternate expression:

	|\.[0-9]*+

Alternate regex pattern:

	([+|-]?((0|[1-9][0-9]*)(\.[0-9]*)?|\.[0-9]+)((E|e)(\+|\-)?[0-9]+)?)

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