http://www.perlmonks.org?node_id=133720

ronperl has asked for the wisdom of the Perl Monks concerning the following question:

how do i replace link=#ccffcc in a html line like:
<BODY text=#FF9900 alink=#44FF22 link=ccffcc>
with link=#000000 ?

thank you

Originally posted as a Categorized Question.

Replies are listed 'Best First'.
Re: how do i replace link=#ccffcc (ex.) in a html line...
by Juerd (Abbot) on Dec 21, 2001 at 11:23 UTC
    Well, using and editor and a keyboard would be one way to do such a thing.
    s/#ccffcc/#000000/ can be used in a variety of editors, and with Perl too.

    If you're on a *nix system and want to replace all occurences in a file, you could use
    perl -i -pe's/#ccffcc/#000000/' file.html
    On DOS-based systems you probably need to use double instead of single quotes.

    Good luck!