简体   繁体   中英

Is there a Regular Expression for blank input?

这可能是一个愚蠢的问题,但是有一个正则表达式来验证blanks或根本没有用户输入吗?

Start of line immediately followed by end of line:

^$

Any amount of whitespace, including none:

^\s*$

^$ should do the trick. ^ matches the beginning and $ the end of the string.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM