To match any decimal digit between 0 through 9, follow the following pattern −
[0-9]
Example
You can try to run the following code to learn how to find digits between brackets in JavaScript RegExp −
<html> <head> <title>JavaScript Regular Expression</title> </head> <body> <script> var myStr = "987654"; var reg = /[4-6]/g; var match = myStr.match(reg); document.write(match); </script> </body> </html>