javascript - getting a number using regular expressions -


this question has answer here:

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

Popular posts from this blog

java - nested exception is org.hibernate.exception.SQLGrammarException: could not extract ResultSet Hibernate+SpringMVC -

sql - Postgresql tables exists, but getting "relation does not exist" when querying -

asp.net mvc - breakpoint on javascript in CSHTML? -