[x3d-public] SFImage regex

Don Brutzman brutzman at nps.edu
Thu Jun 7 23:17:27 PDT 2018


i tried testing this against PixelTexture value

	2 4 3 0xff0000 0xffff00 0x007700 0xff0077 0x0000ff 0xff7700 0x00ff77 0x888888

from scene

	http://X3dGraphics.com/examples/X3dForWebAuthors/Chapter05AppearanceMaterialTextures/PixelTexture.x3d

using https://regex101.com and that tests satisfactorily.

however the default value of '0 0 0' fails according to XML Spy, so there is still a problem here...

in any case, great start! have added it to X3D v4.0 schema for further experimentation, in this case under the annotations until working better.

deployed online.  however can't get svn to work here so checkins will be another time.

http://www.web3d.org/specifications/X3dSchemaDocumentation4.0/x3d-4.0_SFImage.html


On 6/7/2018 11:11 AM, Andreas Plesch wrote:
> Ok, let's give it a try:
> 
> [ \t]*(([0-9]|[1-9][0-9]+)([ ]+|$)){3}(([0-9]|([1-9][0-9]+)|(0x([0-9]|[a-f]|[A-F])+))([ ]+|$))*
> 
> In words:
> 
> match any leading white space followed by
> exactly three times the following
>   - one of the following
>     - either a single digit (including 0) or
>     - a two or more digit number starting with a 1 to 9 digit
>   - followed by either
>    - one or more spaces
>    - or the end of the string (accommodating the default '0 0 0' case)
> then optionally followed zero or more times by
>    - one of the following
>      - either a single digit (including 0) or
>      - a two or more digit number starting with a 1 to 9 digit
>      - 0x followed by at least one of
>         - a single digit or
>         - a to f letter or
>         - A to F letter
>    - followed by either
>      - one or more spaces
>      - or the end of the string


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