Regular expression---judgment is not empty

1. It is used to judge whether the textarea is all empty (cannot be all spaces and newlines, and the front and back of the characters are allowed to be empty)

/^[\s\S]*.*[^\s][\s\S]*$/

[\s\S]* can be preceded by any character
.*[^\s] any non-space and non-newline character


Guess you like

Origin blog.csdn.net/qq_31808899/article/details/77966273