note
haukex
<blockquote><i><c>my $pattern = join "|", map quotemeta, keys %replacements;</c></i></blockquote>
<p>I think it would be good to also sort on length, as I discussed in [id://1179840]. Although [huck] does [id://1199209|make a good point] that preserving the original ordering may be important too. <small><i>Update after your reply:</i></small> Good point about replacements within the replacements, whether the OP wants that or not and which method is more appropriate will depend on their requirements.</p>
1199207
1199211