This
#!/usr/bin/env perl use 5.36.1; use warnings; use strict; use utf8; use autodie; use warnings qw< FATAL utf8 >; use open qw< :std :utf8 >; use charnames qw< :full >; use feature qw< unicode_strings >; binmode(STDIN, ":utf8"); binmode(STDOUT, ":utf8"); binmode(STDERR, ":utf8"); use Text::Undiacritic qw(undiacritic); $^I = ".bak"; my $voir = '**Voir :** proton, solution hydrogénée'; $voir =~ s/ (?:^\*\*Voir\s:\*\* | \G(?!^) (?!\[)) \K (\s?) ((\w[\/*]*) (?:[^\.,;\n\r]\s?)+) [\/*]*([\.,;])?[\/*]* / "$1\[\[glossaire:entrees:" .lc(undiacritic($3)) .":" .lc(undiacritic($2 =~ tr[ \/*][_]dr)) ."|" .$2 =~ tr[\/*][]dr ."\]\]" .(defined($4) ? $4 =~ tr[\/*][]dr : '.') /gemx; print $voir, "\n";
gives me
**Voir :** [[glossaire:entrees:p:proton|proton]], [[glossaire:entrees: +s:solution_hydrogenee|solution hydrogénée]].
So not seeing the line break issue.

In reply to Re: Unexpected line breaks in substitution results by Danny
in thread Unexpected line breaks in substitution results by paschacroutt

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.