in reply to Re^3: guestbook font [colors]
in thread guestbook font [colors]

Okay, in my real code I have a database filled with color codes that are available. All codes have the same open and close tag, with the close having /.

I'm iterating over my messages in a foreach() loop and splitting the messages up into individual data chunks (data, name, url, and message).

From here, I want to filter the message for color codes (which I'd probably push into an array.

my @array = qw(red blue orange); $message =~ s///; # subs all occurences of [red]test[/red] or [blue] w +oot! [/blue].

A real world look at what the message might be:

How [red]much would[red] could a wood [blue]huck chuck[blue]. If a [re +d]wood chuch could chuck[/red] wood? All the wood that peter pan is m +ade of.

The output is pretty self explanatory which would be the real font color="red", color="blue" tags.

Code tags added by GrandFather

Replies are listed 'Best First'.
Re^5: guestbook font [colors]
by GrandFather (Saint) on Aug 09, 2006 at 04:37 UTC

    So you are suggesting that you are translating markup from a [stuff] form to HTML? If so, why didn't you say that in the first place and give some examples of the original text including nasty cases and a sample of the output text that you would like to be generated. If that is not what you are trying to do then I have no idea and you should give a before and after sample to clarify the problem.


    DWIM is Perl's answer to Gödel