test javascript regex
匹配模式
flags:
"g": 匹配所有可能的字串
"i": 忽略大小写
"gi": 匹配所有可能的字串及忽略大小写
测试字符串:
1234g56t78
选择方法
exec
test
match
search
replace
split
dest regex:
dest expression:
return type:
result:
regex lastIndex:
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: <A:[^<>\.]*\.(说明|NUM|时间)> test regex flags: g test string:<A:xxx.NUM> 5. 贪婪的 test regex: <body>(.|\n)*</body> test regex flags: gi test string:<body>zzbz </body>adsdad <body>adsasda</body> adsdad 6. 非贪婪的 test regex: <body>(.|\n)*?</body> test regex flags: gi test string:<body>zzbz </body>adsdad <body>adsasda</body> adsdad
更多工具
版权信息
首页
加入我们
联系管理员
联系管理员2
2006-2009 funnyai.com.
沪ICP备08009295-2号