Group Characters ( () )

You can group characters together, so that they are treated as one character, with parentheses.

Regular ExpressionMatchNot a Match
a(bc)?xabcx, ax, 1axabx, acx
^a.(bc)5axbc5, aqbc56axb5, aqc5, 1axb

Get Spring Into Linux® now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.