The write method of the regular expression of the processing time on the page! (notes)

xiaoxiao2021-03-06  73

It is now necessary to establish a regular expression of a processing time, so the syntax of the regular expression can be established as follows: ^ (([0-1] [0-9]) | 2 [0-3]): [0- 5] [0-9] $ (this is a bitter

). However, a moderation of the input time is required before using the regular expression.

See the matching method of a regular expression of the online, I didn't understand!

Function Reginput (REG)

{

Var srcelem = Event.srcelement

Var = Document.selection.createRange ()

Var srcrange = srcelem.createtextRange ()

Osel.seetendPoint ("StartTostart", SrcRange

VAR num = =text string.fromcharcode (event.keycode) srcrange.text.substr (Osel.Text.length)

Event.ReturnValue = reg.test (Num)

}

Plus the method of processing the filter field, such as the filter '.

^ [^ '] * $ The previous method can filter the' number.

转载请注明原文地址:https://www.9cbs.com/read-92412.html

New Post(0)