We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: June 24, 2019).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Complex RegEx do not work in SfMaskedEdit

Thread ID:

Created:

Updated:

Platform:

Replies:

147510 Sep 13,2019 09:59 AM UTC Sep 16,2019 06:51 AM UTC Xamarin.Forms 3
loading
Tags: SfMaskedEdit
Martin
Asked On September 13, 2019 09:59 AM UTC

Hi,

is the complexity of RegEx masks for the SfMaskedEdit restricted in some way? I've noticed that I had problems with some expresions for e-mail or phone validation. I now wanted to create an input for datetime and wanted to use a RegEx mask that would already restrict the input to valid datetimes. The expression works in several online testtools i found, based on javascript and on .net, but using it in the SfMaskedEdit leads to some symbols being shown in the entry and the app crashing as soon as I write something in it.

^(?=\d)(?:(?:31(?!.(?:0?[2469]|11))|(?:30|29)(?!.0?2)|29(?=.0?2.(?:(?:(?:1[6-9]|[2-9]\d)?(?:0[48]|[2468][048]|[13579][26])|(?:(?:16|[2468][048]|[3579][26])00)))(?:\x20|$))|(?:2[0-8]|1\d|0?[1-9]))([-./])(?:1[012]|0?[1-9])\1(?:1[6-9]|[2-9]\d)?\d\d(?:(?=\x20\d)\x20|$))?(((0?[1-9]|1[012])(:[0-5]\d){0,2}(\x20[AP]M))|([01]\d|2[0-3])(:[0-5]\d){1,2})?$

regards
Martin

Vignesh Ramesh [Syncfusion]
Replied On September 13, 2019 01:53 PM UTC

Hi Martin,  
  
Greetings from Syncfusion.  
  
We would like to convey that we have provide support for limited Mask. Please refer the following user guide link for more information about regular expression that supported by MaskedEdit.  
  
Regards,  
Vignesh. 


Martin
Replied On September 16, 2019 06:43 AM UTC

Hello Vignesh,

I had a look into the documentation before, but I interpreted it more like a guideline than a restriction. It might help to mention the restriction to those specific mask characters in the documentation. Now that I know about it, i can adjust my code accordingly.

Thanks
Martin

Rachel A [Syncfusion]
Replied On September 16, 2019 06:51 AM UTC

Hi Martin, 
 
Thanks for your suggestion. 
 
We have considered your suggestion in improving the documentation and it will updated in the documentation content shortly. 
 
Thanks, 
Rachel.   


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile
Live Chat Icon