String: Display regex error on invalid group reference (#1537)

This commit is contained in:
Tasos Sahanidis 2023-06-04 22:51:27 +03:00 committed by GitHub
parent 416a05e326
commit 6021f0e6d9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -218,6 +218,7 @@ class String(callbacks.Plugin):
s/regexp/replacement/flags, returns the result of applying such a
regexp to <text>.
"""
try:
if f('') and len(f(' ')) > len(f(''))+1: # Matches the empty string.
s = _('You probably don\'t want to match the empty string.')
irc.error(s)