Javascript examples for RegExp:Match Number
Split a string on the first number occurrence using regex
<html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <script type="text/javascript"> window.onload=( function() {//from w w w.j a va 2s .com var str="72 g abc def 101 ddd 108 g aaa 111 spuc loi 32 test"; var regex=/\b(?=\d)/g; console.log(str.split(regex)); }); </script> </head> <body> </body> </html>