正则表达式之特定场景不包含特定单词,如不包含hello

string.match(/((?!hello).)*/)

(?!hello)表示不包含hello,

(?!hello).表示不包含hello的任意字符

猜你喜欢

转载自www.cnblogs.com/szatpig/p/12121062.html