molily: String-Objekten per prototype trim()-Methode geben

Beitrag lesen

Hallo,

Nicht so einfach optimiert werden könnte dagegen etwas wie re = RegExp.new("/some regex/");.

Ja, das wird auch in JavaScript 1.3 angesprochen:

»The constructor of the regular expression object, for example, new RegExp("ab+c"), provides runtime compilation of the regular expression. Use the constructor function when you know the regular expression pattern will be changing, or you don't know the pattern and are getting it from another source, such as user input.«

http://devedge-temp.mozilla.org/library/manuals/2000/javascript/1.3/reference/regexp.html

Mathias