There are two core methods in regular expressions:
1) test verification verifies whether our string complies with the rule of regular expression
Syntax: reg.test (the string you want to test)
Return value: one is a boolean type true conforms to the rule false does not conform to the rule
2) exec capture gets a string that meets our rules from a string.
Syntax: reg.exec (the string you want to capture)
Return value:
null: If the string I want to capture does not appear in the original string, Then return a null
array: [0] is the captured fragment (no matter how many fragments you have, the first fragment is captured; no matter how many times you capture, the first fragment is also captured)