Home >Web Front-end >HTML Tutorial >Match any string containing N occurrences of p
To match any string containing N p sequences with a JavaScript RegExp, use the p{N} quantifier.
You can try running the following code to match any string containing N p sequences -
<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>
The above is the detailed content of Match any string containing N occurrences of p. For more information, please follow other related articles on the PHP Chinese website!