Reputation: 1
I have an .xsd file that has an element wich needs to conform to the following regex: ^[0-9]{1,9}$
According to ChatGPT and Copilot, this regex means that the value must have between one and nine characters, consisting only of numbers from zero to nine.
Based on ChatGPT, Copilot, and Regex101 the value 123456789 is valid for this regex, but if I try to validate it using xmlSchemaValidateDoc from LibXML2 using Delphi it doesn't accept it as valid value.
If I test ^123456789$ LibXML2 says it is a valid value, but Regex101 does not.
Does LibXML2 undesrtand that the beginnig and end are implicit, and because of that does not consider, or validate those anchors?
I don't think it is relevant, but I'm using Delphi to communicate with the LibXML2 DLL and call its functions.
I tried removing both ^and $ from the regex, and it works like a charm, but the doubt still remains.
Thanks in advance for any insights.
Upvotes: 0
Views: 13