Prev Demo
JavaScript
>
Matching Atleast X Digits
Next Demo
Write code here
J
|
B
|
A
<!DOCTYPE html> <html> <head> <title>Demo</title> </head> <body> <p>Click the below button to match a sequence of atleast 4 digit number.</p> <input type="button" value="Click" onclick="mySearch()" /> <p id="myId"></p> <script> function mySearch() { var A = "525245, 4527, 651, 78452, 35, 4, 548624"; var B = /\d{4,}/g; var R = A.match(B); document.getElementById("myId").innerHTML = R; } </script> </body> </html>
Note: We DO NOT save your trial code in our database.
Output