Rodney Wise wrote: > > I'm trying to place HTML Tags around the contents of Quoted material. > > I'm using the following PERL code: > $TextBlockToConvert =~ s/"(.+?)"/"<FONT Color=BLUE>\1<\/Font>"/g; > > Below, is an example of problem text this code chokes on. > > Example Text: msgStop("", "Invalid date") > > 1. The 1st set of Quotes have no contents and so it is > simply ignored. > > 2. The code then finds the next set of Quotes... which is ", " > NOTE: These Quotes do not belong to the same pair. > The HTML formatting code is applied to the comma. > > 3. Finally, the last set of Quotes are ignored because the > code thinks there is only a single last Quote left. > > In this example (above), I would like the find only the last pair of quotes > and substitute its contents with the same text, plus the HTML formatting > code. > > Any help would be certainly appreciated.
$TextBlockToConvert =~ s/"([^"]*)"/length $1 ? '"<FONT Color=BLUE>\1<\/Font>"' : '""'/eg; John -- use Perl; program fulfillment -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]