FHIR Chat · XML Schema for regex? · fhirpath

Stream: fhirpath

Topic: XML Schema for regex?


view this post on Zulip Bryn Rhodes (Feb 01 2019 at 04:04):

This comment (GF#19891) suggests that FHIRPath standardize on the regex schema (SHALL, instead of SHOULD). We intentionally made it a recommendation to reduce implementer burden, any thoughts on whether we should go ahead and rqeuire XML Schema regex?

view this post on Zulip Grahame Grieve (Feb 01 2019 at 04:07):

is there a way to find out what libraries are compliant? a test set?

view this post on Zulip Lloyd McKenzie (Feb 01 2019 at 04:15):

The operation is pretty useless if it's not implemented consistently across platforms...

view this post on Zulip Bryn Rhodes (Feb 01 2019 at 04:16):

https://stackoverflow.com/questions/15819919/where-can-i-find-unit-tests-for-regular-expressions-in-multiple-languages

view this post on Zulip Bryn Rhodes (Feb 01 2019 at 04:17):

And there's RegexBuddy, we can have it just translate flavors for us: https://www.regular-expressions.info/refflavors.html

view this post on Zulip Bryn Rhodes (Feb 01 2019 at 04:18):

245 flavors!

view this post on Zulip Grahame Grieve (Feb 01 2019 at 04:19):

the stack overflow reference is nice, but which is the schema one(s)?

view this post on Zulip Bryn Rhodes (Feb 01 2019 at 04:20):

https://www.regular-expressions.info/xml.html

view this post on Zulip Bryn Rhodes (Feb 01 2019 at 04:21):

Reading up on the XML Schema one there is interesting.

view this post on Zulip Bryn Rhodes (Feb 01 2019 at 04:22):

Based on that writeup, my guess is that all of those test suites would fail on an XML Schema regex engine.

view this post on Zulip Bryn Rhodes (Feb 01 2019 at 04:22):

(Because they would test features the XML Schema regex doesn't support)

view this post on Zulip Grahame Grieve (Feb 01 2019 at 04:26):

XML regular expressions don't have any tokens like \xFF or \uFFFF to match particular (non-printable) characters. You have to add them as literal characters to your regex. If you are entering the regex into an XML file using a plain text editor, then you can use the ￿ XML syntax. Otherwise, you'll need to paste in the characters from a character map.

view this post on Zulip Grahame Grieve (Feb 01 2019 at 04:26):

this is fatal. Very very fatal. We cannot recommend let alone require schema regex

view this post on Zulip Bryn Rhodes (Feb 01 2019 at 04:27):

Yeah, it seems very specific to supporting XML.

view this post on Zulip Bryn Rhodes (Feb 01 2019 at 04:31):

I think it depends on your platform and requiring support for a particular flavor would be onerous.

view this post on Zulip Bryn Rhodes (Feb 01 2019 at 04:32):

We should change the recommended one to PCRE

view this post on Zulip Bryn Rhodes (Feb 01 2019 at 04:32):

Or the ECMAScript one that's part of JavaScript.

view this post on Zulip Grahame Grieve (Feb 01 2019 at 04:34):

PCRE works for me

view this post on Zulip Paul Lynch (Feb 01 2019 at 16:02):

It looks like PCRE is not what web browsers use. Browsers may eventually catch up, and there are some packages to translate PCRE (https://github.com/TooTallNate/pcre-to-regexp, https://medium.com/@DmitrySoshnikov/using-modern-regexes-in-javascript-30322af557c5) but they are not complete solutions.


Last updated: Apr 12 2022 at 19:14 UTC