Quoting Jonas Smedegaard (2025-08-29 17:09:49)
> Some upstream projects tag prereleases as 1.2.3-BETA2 or 1.2.3-beta.2
> or 1.2.3-beta-2.

...and some projects tag prereleases unnumbered, like 1.2.3-BETA

I propose this regex which also covers that:

  s/\d\K[_.+-]?((?i)dev|pre|alpha|beta|rc)[.-]?/~$1/

Downside to this simpler regex is that it also wrongly matches e.g.
1.2.3-beta-max into 1.2.3~betamax, but I would suspect such tags highly
unlikely to both exist and be relevant in a Debian context.

 - Jonas

-- 
 * Jonas Smedegaard - idealist & Internet-arkitekt
 * Tlf.: +45 40843136  Website: http://dr.jones.dk/
 * Sponsorship: https://ko-fi.com/drjones

 [x] quote me freely  [ ] ask before reusing  [ ] keep private

Attachment: signature.asc
Description: signature

Reply via email to