ewoutkramer / fhir-net-fhirpath

[Obsolete - see below] .NET Implementation of the HL7 FhirPath Query language
Other
8 stars 5 forks source link

regex matches function seems to be using \ as a delmiter #7

Open brianpos opened 8 years ago

brianpos commented 8 years ago

The spec doesn't indicate that there should be any delimiting of string expressions, so the below expression should work, however it is requiring the \ characters to be delimited.

'^(?(")(".+?(?<!\\)"@)|(([0-9a-z]((\.(?!\.))|[-!#\$%&\*\+/=\?\^`\{\}\|~\w])*)(?<=[0-9a-z])@))(?(\[)(\[(\d{1,3}\.){3}\d{1,3}\])|(([0-9a-z][-\w]*[0-9a-z]*\.)+[a-z0-9][\-a-z0-9]{0,22}[a-z0-9]))$'

so if you replace all the \ with a \ this expression does work, but think isn't wanted/needed.

ewoutkramer commented 8 years ago

Hi Brian, I don't really get what's wrong? The normal escaping rules for strings in FluentPath say that you should escape the \ (with a double ) to get them across to the regex? We don't have an equivalent of say "@" in .NET in FP...