+
in regex pattern means more than once
. For example, a regex pattern a+
could match aa
and aaa
.
+
must follow a pattern you want to match at least once. So a single +
does't make sense and will give the error nothing to repeat
.
If you just want to match a +
itself, use \+
.