Regular Expression for matching parentheses

Two options:

Firstly, you can escape it using a backslash — \(

Alternatively, since it’s a single character, you can put it in a character class, where it doesn’t need to be escaped — [(]

Leave a Comment