示例您可以尝试运行以下代码来匹配包含 n p 序列的任何字符串 -
<html> <head> <title>javascript regular expression</title> </head> <body> <script> var mystr = "welcome 1, 100, 10000, 1000"; var reg = /\d{3}/g; var match = mystr.match(reg); document.write(match); </script> </body></html>
以上就是匹配任何包含n个p的字符串的详细内容。
