I'm trying to regex the contents of a textarea to be between 4 and 138 characters.
My regular expression is this: '/^.{4,138}$/'
But - I want the user to be able to include return characters, which I believe the "." keeps them from doing. Thoughts on what I need to change?
EDIT :
Obviously there are other ways to get the length of text - strlen
...etc, but I'm looking for regex specifically due to the nature of the check (ie a plugin that requires regex)
I want the user to be able to include return characters, which I believe the "." keeps them from doing. Thoughts on what I need to change?
Either:
.
to [\s\S]
(whitespace/newlines are part of \s
, all the rest is part of \S
)
/…/s
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With