Regular expression
1. {1,} {1,} matches all {2,} "matches all BBBs in" abbb "but does not match any characters in" AB "
Example: var str0 = "aaabcbbb" str0 = str0.replace (/ b / g, "k"); document.write (str0); document.write ("
")
Var str = "aaabcbbb" str = str.replace (/ b {1,} / g, "k"); Document.write (STR); document.write ("
")
Var str1 = "aaabcbbb" str1 = str1.replace (/ b {2,} / g, "k"); Document.write (STR1);
Output: Aaakckaaabckaaakckkkk
2. $ this should be all matches, not a character in the string (the verification)
Must be a digital var r = /^[0-9】}; document.write ("/" ");
3. [0-9%.] 0-9 Don't say,%. It is the accumulation of match characters.