Skip to content

Commit e7f55ff

Browse files
committed
^ also has special meaning inside []
1 parent 18dce3a commit e7f55ff

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

cheatsheet.rst

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,9 @@ Special characters::
1414

1515
No special chars do anything special inside ``[]``, hence they don't need
1616
escaping, except for ``']'`` and ``'-'``, which only need escaping if they are
17-
not the 1st char. e.g. ``'[]]'`` matches ``']'``.
17+
not the 1st char. e.g. ``'[]]'`` matches ``']'``. ``'^'`` also has special meaning,
18+
it negates the group if it's the first character in the ``[]``, and needs to be
19+
escaped if you want to match it literally.
1820

1921
Quantifiers::
2022

0 commit comments

Comments
 (0)