Alex Young
8/19/2006 4:11:00 PM
Patrick Spence wrote:
> I have a string something like this...
> "Now is the time for all good men to blah, blah..." - Origin unknown
>
> I want to convert it to this...
> [i]Now is the time for all good men to blah, blah...[/i] - Origin
> unknown
>
> With the first double quote converted to "[i]" and the second to "[/i]".
> The occurance of the 1st double quote may or may not be at the beginning
> of the string.
>
>
Rather simplistic, but should work:
string.sub(/"([^"]*)"/, '[i]\1[/i]')
--
Alex