[x3d-public] X3D Regex

Joseph D Williams joedwil at earthlink.net
Wed Jun 6 13:51:50 PDT 2018



Sent from Mail for Windows 10

From: Andreas Plesch
Sent: Wednesday, June 6, 2018 10:39 AM
To: X3D Graphics public mailing list
Subject: Re: [x3d-public] X3D Regex

> Date: Wed, 6 Jun 2018 09:23:09 -0700
> From: Don Brutzman <brutzman at nps.edu>
> To: X3D Graphics Working Group <x3d at web3d.org>
> Cc: X3D Graphics public mailing list <x3d-public at web3d.org>, "Humanoid
>         Animation (H-Anim) Working Group" <h-anim at web3d.org>
> Subject: [x3d-public] X3D teleconference 5 JUN 2018 minutes: HAnim
>         DIS, X3D Regex, Web3D 2018 and X3Dv4
>
...
>         X3D Regular Expressions (regexes)
>         http://www.web3d.org/specifications/X3dRegularExpressions.html
>
> Vince reports that MFInt32 problem stack-overflow error still remains when running X3D Schematron locally.  He will post the abridged example that is still failing, hopefully that will help our test efforts.
>
> MFInt32 regex pattern:
>
>         ((\+|\-)?(0|[1-9][0-9]*)?( )?(,)?( )?)*
>         http://www.web3d.org/specifications/X3dRegularExpressions.html#MFInt32

>> I am looking at this regex and have a few questions.

>> All groups are optional, so it seems to also match an empty string "".
>> Perhaps not a problem, or even intentional.

Totally intentional. We need the ability to legally load the node with no content then later, prior to actually running the scene. Add some attr content.

>> It matches a mix of commas and spaces, for example ",,,  , ,, ,,  ".
>> This does not look like an acceptable MFInt32 value.

Well, either space or comma is legal sep. Mix reads poorly but legal if number of 

>> The second group (0|[1-9][0-9]*) : This is harder to understand. It
seems to want to address leading zeros. Why not just use ([0-9]*) ?
Using https://regexr.com/ and https://regex101.com/ I could not come
up with a pattern where these expressions were not equivalent. What
would be an example where ([0-9]*) would not work ?

leading zero for decimal value?

>> http://www.web3d.org/documents/specifications/19776-1/V3.3/Part01/EncodingOfFields.html#SFInt32
allows hexadecimal values, using 0x prefix. I have never seen this but
the regex would not match, eg. produces a false negative.

Looks like hex needs better regex. 

>> -Andreas

Thanks and Best, 
Joe

-- 
Andreas Plesch
Waltham, MA 02453

_______________________________________________
x3d-public mailing list
x3d-public at web3d.org
http://web3d.org/mailman/listinfo/x3d-public_web3d.org

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://web3d.org/pipermail/x3d-public_web3d.org/attachments/20180606/ae9fc0b5/attachment.html>


More information about the x3d-public mailing list