Thank you for your help Anomalous Monk, I have applied the substitions you proposed and every thing works fine
use strict; use warnings; my $text = do { local $/; <>; }; my %replacement = ( 'b' =>' Schwarz am Zug', 'w' => 'Weiß am Zug', ); ;; my $condition = qr{ \b (?: b | w) \b }xms; $text =~ s{ Event \s+ " \K [?] (?= " .*? FEN [^\n]* \s+ ($condition) \s+ -) } {$replacement{$1}}xmsg; print $text;
In reply to Re^4: regex replace a string
by OldChamp
in thread regex replace a string
by OldChamp
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |