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
225
TextEditor - email validation - regExp
posted

Hello, 

I am trying to validate email address in TextEditor by using regular expression but the result is not same as in online regexp tester and I don’t know why. I tried email address abc.abc@abc and it passed validation in TextEditor but in online regexp tester didn’t. I tried it in multiple online reqexp testers and every time the email address didn’t pass the validation which is correct. Another problem is when I type in bigger quantity of numbers e.g. ‘12345678912345679132456798134567981345665456476545648967564’ the page will freeze.

There is my code: 

@(Html.Infragistics()

            .TextEditor()

            .ID("test")

            .ValidatorOptions(options => options.OnBlur(true).RegExp(@"[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?"))

            .Render()

       )

Thank you