javascript - getting a number using regular expressions -
this question has answer here:
- regular expression extracting number 4 answers
i have following string:
pr-1333|testtt
i want number 1333 using regular expressions in javascript. how can that?
this numbers in text.
var text = "pr-1333|testtt"; var number = text.match(/\d+/g); // returns array of found. console.log(number[0]); // 1333
Comments
Post a Comment