Home > front end >  Regular expression
Regular expression

Time:09-23

There is a text content is such

Order time
The 2020-03-29 18:19:35
Promised delivery time
The 2020-04-03 23:59:59
Spelling a single successful time
The 2020-03-30 18:18:43

To get to the 2020-04-03 23:59:59 this lines, with regular how to write?

$(' # OrderNumber). Val (o.v al () the match (how to write a regular here);

Regular rookie help

CodePudding user response:

O.v al (). The match (\ n/promise the delivery time ([\ s \ s] +) \ n/spelling a single successful time) [1].

CodePudding user response:

 
Var STR=` order time
The 2020-03-29 18:19:35
Promised delivery time
The 2020-04-03 23:59:59
Spelling a single successful time
The 2020-03-30 18:18:43 `;
Var matchReg=/(? & lt;=promise delivery time). *? (?=spell single successful time)/;
STR=STR. Replace (/\ r \ n/g, "");//remove the enter
STR=STR. Replace (/(\ s) {2}/g, "");//more Spaces
Alert (STR) match (matchReg));

CodePudding user response:

\ d {4} - \ d {2} {2} - \ d \ d {2} : \ d {2}
^ [0-9] {4} + [-] + [0-9] {2} + [-] + [0-9] {2} + [] + [0-9] {2} + [:] + [0-9] {2} $primary long, and there is a range of time, this can't distinguish range is correct

CodePudding user response:

$(' # OrderNumber). Val (o.v al () the match (\ s +/promise the delivery time (\ d {4} - \ d {2} {2} - \ d \ d {2} : \ d {2} : \ d {2})/) [1]).
  •  Tags:  
  • ASP
  • Related