What does `.` match?

0120

In regular expressions, the dot (.) is a special character that matches any single character except for newline characters (like \n). This makes it a versatile tool for creating patterns that can match various characters in a string.

Example:

  • The regex a.b would match:
    • aab
    • acb
    • a1b

But it would not match:

  • ab (missing a character between a and b)
  • a\nb (because of the newline)

If you have more questions about regular expressions or need examples, feel free to ask!

0 Comments

no data
Be the first to share your comment!