简体   繁体   中英

Blank Regular Expression

Using Cforms and adding some validation in, thought i'd throw in the Honeypot method as well. With cforms it allows you to add a Regex into a field, but I have been trying to figure out how to create a "blank" regex.

the best I have so far is to put a space into the field then use this regex: ^\\s This works perfectly well, but just out of pure interest, is there a pure blank version, so that if ANY character is typed in then it won't validate.

Thanks

Like this? ^$ (start+end with nothing in between).

只是添加了另一种做相同事情的方式: .{0}

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