📅  最后修改于: 2022-03-11 15:01:55.093000             🧑  作者: Mango
var regex = /\d+/g;
var string = "Any string you want!";
var matches = string.match(regex); // creates array from matches
if (matches){
// There is a digit in the string.
} else {
// No Digits found in the string.
}