Hello everybody,
This is my code:
#!/usr/bin/perl my $string = "P5§2\nAAA\nBBB\nCCC\nP6§21\n"; $string =~ s/^(P\d+[^\n]*?\n) (([^\n]+) (\n))+ (?:P\d+[^\n]*?)$ /$1$2/xsmig;# print "\$string is \n$string \n";
I got this output:
P5º2 CCC
And I would like to get this one:
P5º2 AAABBBCCC
Thank you for your help
Benchrifa
In reply to Unable to replace targeted newlines in a string by benchrifa
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |