gruss Nick,
...
Ich habe das bisher so gelöst, würde mich aber nicht wundern,
wenn das nicht auch schlanker ginge:
...
...
Wer hat einen Tipp ?
...
probier es doch mal mit einer gruppe alternativer ausdruecke und
deren gespeicherter referenz beim ersetzen:
/*
code bitte in die [link:http://jconsole.com/@title=[jconsole\]] pasten
*/
var str = "Haus mit Garage, Villa mit Pool, Laube mit Fenster, aber immer mit Strom";
var regXImmobilieMit = (/(Haus|Villa|Laube)(\s+)mit/g);
str = str.replace(regXImmobilieMit, "$1$2ohne");
print(str); // alert(str);
so long - peterS. - pseliger@gmx.net
--
»Because objects in JavaScript are so flexible, you will want to think differently about class hierarchies.
Deep hierarchies are inappropriate. Shallow hierarchies are efficient and expressive.« - Douglas Crockford
ie:( fl:) br:> va:( ls:& fo:) rl:) n3;} n4:} ss:} de:µ js:} mo:? zu:]
»Because objects in JavaScript are so flexible, you will want to think differently about class hierarchies.
Deep hierarchies are inappropriate. Shallow hierarchies are efficient and expressive.« - Douglas Crockford
ie:( fl:) br:> va:( ls:& fo:) rl:) n3;} n4:} ss:} de:µ js:} mo:? zu:]