Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

replace(/\s|:/gm, "") wtheck

Name: Anonymous 2011-11-03 22:47

I was translating a flash object into a C++ object and I ran into this..

public static function toArray(param1:String) : ByteArray
{
    param1 = param1.replace(/\s|:/gm, "");

What in the world is "/\s|:/gm"? can anyone give me an explanation or link to some documentation?

Name: Anonymous 2011-11-03 22:58

It's a regular expression. It searches for all space-class characters followed by '|' followed by ':' matching globally (g) and multi-line (m). It scans a string and removes the sequence of three characters at any point in the string where strlen(s) >= 3 && isspace(s[0]) && s[1] == '|' && s[2] == ':' (C code) is true.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List