JavaScript Regular Expressions: ()

By: Dusty Arlia
Published on Sunday, October 13, 2013, 05:26 PM
Last Updated on Saturday, July 11, 2015 at 7:52 PM
Total Updates: 2

Parentheses are used in regular expressions in a couple different ways:

  • Creating subexpressions to be treated as a single unit with the *, +, and ? repetition characters or the | alternation character that follows it.
  • Defining subpatterns to be extracted from the target string.
  • To be referenced later using reference characters (\1, \2, \3, … \[n])

Comments:

Ad: