Regex to limit field length - strange result

Jane du Plessis November 1, 2017

I've created a regex validator for a field  .{3,} to match at least three characters entered in the description. This works fine until shift + enter is typed into the field.

"background FS text"  -  matches 

"background
FS text"  - does not match

 

any help from someone who has done similar validation ?

1 answer

0 votes
Gregor Kasmann_Actonic
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
November 1, 2017

Try this:

^(.|\n){3,}$

Suggest an answer

Log in or Sign up to answer