in reply to [untitled node, ID 150603]

How can I make a more perfect search and replace, that replaces only words surrounded by white space or by a punctuation mark or marks?

Use \b, that matches null strings at word boundaries. It's described in perlre, but has examples in perlretut:

An anchor useful in basic regexps is the word anchor "\b". This matches a boundary between a word character and a non-word character "\w\W" or "\W\w":
$x = "Housecat catenates house and cat"; $x =~ /cat/; # matches cat in 'housecat' $x =~ /\bcat/; # matches cat in 'catenates' $x =~ /cat\b/; # matches cat in 'housecat' $x =~ /\bcat\b/; # matches 'cat' at end of string
Note in the last example, the end of the string is considered a word boundary.

44696420796F7520732F2F2F65206F
7220756E7061636B3F202F6D736720
6D6521203A29202D2D204A75657264