To sum up the regular expression usage:
<! Doctype HTML public "-// W3C // dtd html 4.0 transitional // en"> <HTML> Code It can be placed in any location and executed sequentially among head labels --> <SCRIPT type = "text/JavaScript"> // The subexpression captures reverse references to meet the condition that the first and last bits are the same, and the second and third bits are the same 4-digit var Regexp =/(\ D) \ 2 \ 1/GI; Function Test (){ VaR Con = Document. getelementbyid ("content" ). Value; // Number of consecutive three {n }, // VaR Regexp =/A {2} 1 {3}/GI; // {N, m} At Least n times at most m times. js greedy principle: Match multiple times first and then match fewer times. // VaR Regexp =/1 {3, 4}/GI; // + Indicates that the message appears once to any number of times. // VaR Regexp =/1 +/GI; // * Indicates 0 to any number of times // VaR Regexp =/A1 */GI; // ? 0 to 1 // VaR Regexp =/A1? /GI; // [A-Z] // VaR Regexp =/\./GI; // ^ Start $ end Locator // VaR Regexp =/Han $/GI; // \ B matches the target string of the boundary (such as space separation) \ B opposite // VaR Regexp =/Han \ B/GI; // | Select matching VaR Regexp =/(Pan | disk )/ GI; While (RES = Regexp.exe C (CON) {window. Alert (RES [ 0 ]) ;}} </SCRIPT>