Home > front end >  High marks for a regular expression
High marks for a regular expression

Time:02-19

Determine whether an id between 0155167 and 0361486, this number must be 7 digits 0 and the front belt

CodePudding user response:

 
The function fu (STR) {
The return/^ \ d {7} $/. The test (STR) & amp; & Str>="0155167" & amp; & Str<="0361486";
}
The console. The log (fu (" 0337456 "));
The console. The log (fu (" 0157456 "));
The console. The log (fu (" 0367456 "));
The console. The log (fu (" 337456 "));
The console. The log (fu (" s337456 "));
  • Related