Basic regex vocabulary

  • ^ and $ — start and end anchors; ^...$ matches the whole string
  • [A-Za-z] — character class; \\d = digit; \\w = word char; \\s = whitespace
  • + = one or more; * = zero or more; ? = optional (zero or one); {n} = exactly n
  • . — any character except newline; \\. — literal dot
  • /i flag — case-insensitive; /g flag — global (find all matches)

Question 0 of 5

How would you describe this regex in plain English? /^[A-Za-z]+$/