regular expression

regular expression

rule

TEXT
1
const <rule name> = /<rugular expression>/

pick

  1. pick for strings that comply with the rules and ruturn boolean

    TEXT
    1
    <rule>.test(<test string>)
  2. search for string that complay with the rules, find ruturn array else return null

    TEXT
    1
    <rule>.exec(<test string>)

replace

TEXT
1
<string>.replace(<rule>,<string>)