Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
1540
How to include a hyphen in a XamMaskedEditor {char:n:s} character set
posted

I am trying to define a mask for a XamMaskedEditor that only accepts valid phone numbers.  I'm using:

 Mask="{}{char:1:+(0-9}{char:31:()\-0-9 }"

This should allow the following characters as the first character (optional): '+', '(' or 0 to 9.

Then any of the following for the remaining characters: '(', ')', '-' or 0 to 9.

However, the escape character '\' seems to be being interpreted as a literal rather than making the following hyphen part of the character set.  Without the escap character, the hyphen is interpreted as a range indicator.

Is there any way of including hyphens as part of the character set?

Thanks,

Jason

Parents
No Data
Reply Children
No Data