This is within a xaml file.
I need to mask a box's input with a regular expression.
I need it to contain either 10 numbers or 13 numbers (in sequence, with no symbols)
I have :
<... ValidationRegEx="\d{13}" />
which works fine, but when i want to add a mask of ten in , it breaks :
<... ValidationRegEx="\d{13} | \d{10}" />
Any ideas?
I thin the spaces should be removed, like this:
ValidationRegEx = "\d{13}|\d{10}"
Otherwise, space characters become part of the string that you match (i.e. 13 digits followed by a space, or a space followed by ten digits).
You could also try simplifying the expression like this:
ValidationRegEx = "\d{10}\d{3}?"
(required ten plus three optional digits).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With