[pmg-devel] [PATCH pmg-gui] utils: escape `/` in regex for emails

Thomas Lamprecht t.lamprecht at proxmox.com
Mon Feb 26 13:14:02 CET 2024


Am 26/02/2024 um 08:07 schrieb Dominik Csapak:
> On 2/23/24 19:11, Stoiko Ivanov wrote:
> 

FYI: this makes it seem like below was written by Stoiko, but it wasn't,
it's rather part of Maximiliano's original commit message.

>>>
>>> Note that `/` marks the end of the regex [1], hence
>>>
>>>      Some at example@oh\no@
>>>
>>> is valid according to this regex if we do not escape `/`.
>>>
> 
> is not because of unescaped '/' but because the regex is not anchored
> and thus only parts of the input must match... (and that it does)
> 

yeah, that seems indeed to be the issue. @Maximiliano can you please try that
and send a patch for it, if it works out.

And FWIW, the extra parenthesis around the regex could be dropped too (just
a code style improvement though), so




More information about the pmg-devel mailing list