In my ASP.NET application I use regex validators to avoid data that is over 1000 characters in multi-line text fields, as per these recommendations. Specifically, I am using this regex:

^.{1,1000}$

This works fine on my development machine and my test environment, but some users (quite a few) are reporting that a validation error message is popping up even when their text is clearly below the specified maximum. Since the validator uses client-side JavaScript and a regular expression, I am wondering whether the particular browser that they are using is somehow failing to carry out the check properly. If this is the case, this is very difficult to debug, as I don't have access to their machines.

Are you aware of any issues like this with the regex validator in ASP.NET? Are there any guidelines to avoid this? How would you try to reproduce this issue in order to debug it?

0 Answers