[pve-devel] [PATCH qemu-server v2 4/4] parse vm config: remove "\s*" from multi-line comment regex

Stefan Sterz s.sterz at proxmox.com
Fri Feb 25 09:26:41 CET 2022


On 24.02.22 17:28, Dietmar Maurer wrote:
> 
>> On 02/24/2022 3:49 PM Stefan Sterz <s.sterz at proxmox.com> wrote:
>>
>>  
>> To be consistent with PBS's implementation of multi-line comments
>> remove "\s*" here too. Since the regex isn't lazy .* matches
>> everything \s* would anyway.
> 
> But the old regex trimm spaces from the end, so this is quite different!

It would if the ".*" was evaluated lazily (as in ".*?"), but from my
testing it isn't. So since ".*" matches spaces greedily, they are
actually not trimmed. The only character that is matched by "\s" and
not by "." are line breaks, but those occur after the "$".
Hence, "\s" should never match anything here. I've also discussed this
with Wolfgang Bumiller off list.





More information about the pve-devel mailing list