[x3d-public] SFImage regex

Andreas Plesch andreasplesch at gmail.com
Mon Jun 11 13:00:56 PDT 2018


> Date: Mon, 11 Jun 2018 11:03:13 -0700
> From: Leonard Daly <Leonard.Daly at realism.com>
> To: x3d-public at web3d.org
> Subject: Re: [x3d-public] SFImage regex
> Message-ID: <bbff6404-96fc-fc91-b9a7-6ba57d98b7e3 at realism.com>
> Content-Type: text/plain; charset="utf-8"; Format="flowed"
>
> Andreas,
>
> There is an error in the regex:
> >
> > Tangentially, repeated ranges also look not so nice but are apparently
> > common: [0-9a-fA-F]
> > [0-9]|[a-f|[A-F] reads better to me and that is why I preferred that.
>
> There should be a ']' after 'f'. Personally, I prefer the first form
>

well spotted !


> [0-9a-fA-f] or even [a-fA-F\d]. If the entire string is case insensitive
> then use the language-specific 'i' mode or surround the entire string as
> in (?i)...[a-f\d]...(?-i) or shorter (?i)...[a-f\d]...
>

The more familiar regex becomes, more concise variations may read better. i
mode may not be supported by XML.


> I prefer grouping all of the ranges together so that repeated
> vertical-ness is not present as it would be with ']|['. It also makes it
> clearer that the range of characters is all one unit.
>

It does. Still, [a-fA-F0-9] may look a bit confusing to the casual regex
users since there is a natural tendency to first join letters, then
consider punctuation or signs.

In the end, it is just a personal preference,

-Andreas


> --
> *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/20180611/9c8f6f22/attachment.html
> >
>
> ------------------------------
>
> Subject: Digest Footer
>
> _______________________________________________
> x3d-public mailing list
> x3d-public at web3d.org
> http://web3d.org/mailman/listinfo/x3d-public_web3d.org
>
>
> ------------------------------
>
> End of x3d-public Digest, Vol 111, Issue 39
> *******************************************
>


-- 
Andreas Plesch
Waltham, MA 02453
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://web3d.org/pipermail/x3d-public_web3d.org/attachments/20180611/b48061ed/attachment.html>


More information about the x3d-public mailing list