From 159a63c85eb77ec321301bc4c4ebfb90343edc2b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Ko=C5=82odziejczak?= <31549762+mrl5@users.noreply.github.com> Date: Tue, 26 Jul 2022 13:19:38 +0200 Subject: [PATCH] doc: add a note about the empty regex This improvement is a consequence of the Q&A discussion from https://github.com/rust-lang/regex/discussions/896 PR #897 --- src/lib.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/lib.rs b/src/lib.rs index 3e3b0a007..6b95739c5 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -353,6 +353,9 @@ $ the end of text (or end-of-line with multi-line mode) \B not a Unicode word boundary +The empty regex is valid and matches the empty string. For example, the empty +regex matches `abc` at positions `0`, `1`, `2` and `3`. + ## Grouping and flags