Javascript examples for RegExp:Match Number
Use Regular Expressions to Find digits in last part of string
<html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <script type="text/javascript"> window.onload=( function() {/*w w w . ja v a2 s. c o m*/ var regex = new RegExp(/\(ID: ([0-9]+)\)/); var test = "Some kind of title (ID: 3456)"; var match = regex.exec(test); console.log('Found: ' + match[1]); }); </script> </head> <body> </body> </html>