var arr:Array = split(str, "\r");
arr.join("<br />");

On 1/19/07, Oliver Müller <[EMAIL PROTECTED]> wrote:
Hi,

I'm looking for a tinier and probably faster solution for my RegExp here:


var pattern:RegExp = /(?!>)(r+)/sg;
var str:String = ">\rjustus\rjustus\rjustus";

function myfunc()
{
    if (arguments[3].substr((arguments[2]-1),1) != ">") return "<br />";
    return "";
}

trace(str.replace(pattern, myfunc));

// result: >justus<br />justus<br />justus


Has anyone a clue ?

--
greets,
Olli
_______________________________________________
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com



--
Cheers,
Ray Chuan
_______________________________________________
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com

Reply via email to