delete-package-versions icon indicating copy to clipboard operation
delete-package-versions copied to clipboard

Corrects the regex examples for `ignore-versions` in the README.md

Open GMZwinge opened this issue 2 years ago • 5 comments

No need to escape the \ in the regex examples. With the extra \, it deletes all but 3 package versions.

GMZwinge avatar Nov 01 '23 22:11 GMZwinge

@GMZwinge sorry for the question, but how do you know that this is correct?

Currently I'm using the regex ^\\d+\\.\\d+$, and the action just deletes all version, even ones like 11.2, ...

If your PR is right it should work if I change my regex to ^\d+\.\d+$?

ghost avatar Feb 21 '24 15:02 ghost

I cant seem to get the ignore-versions option to work with container with either option.

kalinon avatar Mar 13 '24 17:03 kalinon

I cant seem to get the ignore-versions option to work with container with either option.

Same here, tried it with double backslashes in the regex and with single backslashes in the regex. This is very frustrating.

ghost avatar Mar 20 '24 09:03 ghost

@ruben-hoenle-fnt From 7.3.2. Single-Quoted Style: The single-quoted style is specified by surrounding “'” indicators. Therefore, within a single-quoted scalar, such characters need to be repeated. This is the only form of escaping performed in single-quoted scalars. In particular, the “\” and “"” characters may be freely used. The double backslash results in that the action doesn't ignore anything because there is no version that matches the regex. A version matching your regex ^\\d+\\.\\d+$ would look like '\ddd\x\dddwheredcould be repeated any number of times andx` could be any character. See for example this test.

And yes, it should work with ^\d+\.\d+$ to ignore versions like 11.2.

GMZwinge avatar Mar 25 '24 17:03 GMZwinge

@kalinon The issue with container may be due to ignore-versions doesn't seem to work with container packages (ghcr), not an issue with the regex.

GMZwinge avatar Mar 25 '24 17:03 GMZwinge