🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: fr.comp.os.unix
Article #2

remplacer toutes les occurrences sauf la dernière

#2
From: Philippe
Date: Tue, 17 Nov 2026 18:09
25 lines
1478 bytes
[ suivi vers fr.comp.os.unix ]

Bonjour,

Je voudrais remplacer tous les points *sauf* le dernier par des tirets 
dans une chaîne qui peut contenir zéro, un, ou plusieurs points :
abcd -> abcd
abc.d -> abc.d
.abcd -> .abcd
a.b.c.d -> a-b-c.d
ab...cd -> ab--.cd
abcd... -> abcd--.
et cetera ; a,b,c et d ne sont là qu'à titre d'exemple, la chaîne est 
en réalité un nom de fichier.

Une expression régulière (perl, si ça a une importance) serait idéale,
mais n'importe quoi d'autre sera beaucoup mieux que rien.

Je sèche. Quelqu'un a une idée ?

Merci,

-- 
Philippe
Technical Details
Message-ID: <20261117190955.7f22becd@peinard.chezmoi>
Path: mbox-mo1.pugleaf.net!news-lax.pugleaf.net!srl.newsdeef.eu!newsfeed.bofh.team!weretis.net!feeder8.news.weretis.net!news.usenet.ovh!.POSTED!not-for-mail

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-lax.pugleaf.net!srl.newsdeef.eu!newsfeed.bofh.team!weretis.net!feeder8.news.weretis.net!news.usenet.ovh!.POSTED!not-for-mail
From: Philippe <p.naudin+nntp@free.fr>
Newsgroups: fr.comp.lang.regexp,fr.comp.os.unix
Subject: remplacer toutes les occurrences sauf la dernière
Followup-To: fr.comp.os.unix
Date: Tue, 17 Nov 2026 19:09:55 +0100
Organization: NUO - News.Usenet.Ovh
Message-ID: <20261117190955.7f22becd@peinard.chezmoi>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Injection-Info: news.usenet.ovh; posting-account="pnaudin";
	logging-data="455638"; mail-complaints-to="abuse@usenet.ovh"
Cancel-Lock: sha1:l1+M7Eii+A6N3LC4Wy7IUFNl0Jg= sha256:EyuYtvInK81SV7W0KkFfurDw+dnoMbqCNbbwpakGV0w=