[x3d-public] X3D regexes for colorRGBA, image need work; X3DJSAIL junit5 test harness in place
andreasplesch at gmail.com
Tue Jul 24 06:50:34 PDT 2018
I agree with John. Adding anchors is necessary for most, perhaps all regexes.
Outside XML, for example in java, this regex without anchors
matches '1 2' as well as '1',
while the regex with start and end anchors
only matches '1' but not '1 2' which is what is desired for validation,
On Tue, Jul 24, 2018 at 7:43 AM John Carlson <yottzumm at gmail.com> wrote:
> Without anchors, how do you insure all values are checked? Seems like only the first few, or some in the middle will be validated.
> On Tue, Jul 24, 2018 at 2:09 AM Don Brutzman <brutzman at nps.edu> wrote:
>> > Within an xml context, the regexes have an implicit start and end
>> > anchor, see:
>> > https://www.w3.org/TR/xmlschema11-2/#regexs
>> > where anchors are explained.
>> > Therefore it may be necessary to add explicit start (^) and end ($)
>> > anchors to the start and end of each x3d regex when translating to
>> > jsail java methods with the stylesheet as java does not have the
>> > implicit anchoring.
>> in general i have found that anchors are much more trouble than they seem to be worth.
>> in practice, if we ignore/trim leading and training whitespace as part of the re
More information about the x3d-public