1.

What Are Brackets?

Answer»

Brackets ([]) have a SPECIAL meaning when used in the context of regular EXPRESSIONS. They are used to find a range of characters.

  • [...]: Any one character between the brackets.
  • [^...]: Any one character not between the brackets.
  • [0-9]: It matches any DECIMAL digit from 0 through 9.
  • [a-z]: It matches any character from lowercase a through lowercase z.
  • [A-Z]: It matches any character from uppercase A through uppercase Z.
  • [a-Z]: It matches any character from lowercase a through uppercase Z.

The ranges shown above are general; you could ALSO use the range [0-3] to match any decimal digit ranging from 0 through 3, or the range [B-v] to match any lowercase character ranging from b through v.

Brackets ([]) have a special meaning when used in the context of regular expressions. They are used to find a range of characters.

The ranges shown above are general; you could also use the range [0-3] to match any decimal digit ranging from 0 through 3, or the range [b-v] to match any lowercase character ranging from b through v.



Discussion

No Comment Found