Regular Expression matching code
Regular Expressions, also known as regular and regular expressions. (English: Regular Expression, often abbreviated as regex, regexp or RE in code), a concept of computer science. Regular Expressions use a single string to describe and match a series of syntaxes. In many text editors, regular expressions are usually used to retrieve and replace texts that match a certain pattern.
/* RMB amount verification */var testRMB = function (v) {var reg =/^ ([1-9] [\ d] {0, 7} | 0 )(\. [\ d] {1, 2 })? $/; Return reg. test (v); // 12345678.12}/* positive integer verification */var testZZS = function (v) {var reg =/^ [0-9] * [1-9] [0-9] * $/; return reg. test (v); // 12345678.12}
The above is an introduction to the common Regular Expression matching Code introduced by the small Editor. I hope it will be helpful to you. If you have any questions, please leave a message. The small editor will reply to you in time!