Tuesday 16 April 2019

regex tester

script :

var paragraph = '222323';
var regex = '[0-9]{3,}'; //with at least 3 and above digits
var found = paragraph.match(regex);
console.log(found);
//which return back the array of numbers
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/match

No comments:

Post a Comment