Group Characters ( () )
You can group characters together, so that they are treated as one character, with parentheses.
Regular Expression | Match | Not a Match |
---|---|---|
a(bc)?x | abcx, ax, 1ax | abx, acx |
^a.(bc)5 | axbc5, aqbc56 | axb5, 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.