I'm using the following regular expression to match everything:
/^(?=.{10,8000}$).*$/
But now I just realize that .*
doesn't match the newline character. How can I make this regular expression match newlines?
所有空格+非空格=所有字符: [\\S\\s]
/^(?=[\S\s]{10,8000})[\S\s]*$/
Why do you use a regex?
var txt = "Hello World!";
if(length(txt) >= 10 && length(txt) <= 8000) {//match}
var filter = /.*/gim;
这将匹配多行的所有内容。
用这个
var filter = /[\w|\W]*/gim;
I think that is pretty much simpler, just use /.*/
. stands for any character and * allows any repetition of that character.
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.