1. 检查字符串中是否有非数字的字符: test regex: \D test regex flags: g test string: 1234g56t78 2. 检查字符串中是否有非0-9、a~z、A-Z、_的字符: test regex: \W test regex flags: g test string: i'm a pig! yes I'm! 3. 匹配字符串中的实数: test regex: ([\d]+])\.([\d]+) test regex flags: g test string: float1234.58.723c65.183 4. 匹配字符串中的实数: test regex:
\.]*\.(说明|NUM|时间)> test regex flags: g test string:
5. 贪婪的 test regex: (.|\n)* test regex flags: gi test string:zzbz adsdad adsasda adsdad 6. 非贪婪的 test regex: (.|\n)*? test regex flags: gi test string:zzbz adsdad adsasda adsdad
test javascript regex
匹配模式
flags:
"g": 匹配所有可能的字串
"i": 忽略大小写
"gi": 匹配所有可能的字串及忽略大小写
测试字符串:
选择方法
exec
test
match
search
replace
split
dest regex:
dest expression:
return type:
result:
regex lastIndex: