0

I'm using a regex in my validation to determine whether an input on a field is empty.

The regex is as follows: ^(?=\s*\S).*$

However, if the user presses enter, thereby creating a linebreak, on that textarea and writes something after it, the validation fails.

What should I add to that regex so, that it allows linebreaks?

Steve Waters
  • 3,348
  • 9
  • 54
  • 94

0 Answers0