Can regular expressions be used to match nested patterns? [duplicate]

This question already has answers here: Regular expression to match balanced parentheses (21 answers) Closed 3 years ago. Is it possible to write a regular expression that matches a nested pattern that occurs an unknown number of times? For example, can a regular expression match an opening and closing brace when there are an unknown … Read more