Regex tester vs Regex in Mendix

0
Hi, I encounter the following problem with Regex. I have an application that validates the (trimmed) phone number in a microflow using an isMatch and the following Regex; ((?:\+|00)[17](?: |\-)?|(?:\+|00)[1-9]\d{0,2}(?: |\-)?|(?:\+|00)1\-\d{3}(?: |\-)?)?(0\d|\([0-9]{3}\)|[1-9]{0,3})(?:((?: |\-)[0-9]{2}){4}|((?:[0-9]{2}){4})|((?: |\-)[0-9]{3}(?: |\-)[0-9]{4})|([0-9]{7})) When I copy the phone number from iPhone Contacts in the field and try to save that I fails on the split with the Regex. When copying the value of the attribute in a Regex tester it shows a positive result.  Does anyone know if this has something to do with iPhone Contacts? 
asked
2 answers
0

THe answer was given by the Jurre and I've added it here so that the question is marked as answered and can be closed:

 

We have found that there is a unicode character when you copy from iPhone contacts. This was not filtered beforehand even when we trimmed. https://stackoverflow.com/questions/47623828/ios-copy-paste-phone-from-contacts-to-uitextfield-adds-strange-unicode-character We now replace all unicode by using replaceAll(attribute,'\p{Cf}','') You actually can see the unicode in the modeler, but it won't show in any browers or such.

answered
0

Not completely proficient in regex statements, but I can't get a phonenumber to match your regex.

But give this regex, for dutch phonenumbers, a try in your regex tester en the split to see if there is a difference.

(|(^\+)[0-9]{2}|^\+[0-9]{2}\(0\)|^\(\+[0-9]{2}\)\(0\)|^00[0-9]{2}|^0)([0-9]{9}$|[0-9\-\s]{10}$)

Maybe this will give you a clue on the issue with your regex statement.

answered