anapajari s/travail/glanding on hfr/gs; | je cherche pas un autre débat, c'est juste que je ne comprends pas en quoi String.replace ne te convient pas Tu peux très bien faire quelque chose comme ça avec String.replace Code :
- var patterns = [
- { 'pattern' : '<a.*?a>', 'replace': '', 'options': 'gi'},
- { 'pattern' : 'est en', 'replace': '***', 'options': 'g'},
- { 'pattern' : 'est', 'replace': '+++', 'options': 'g'}
- ];
- for (i in patterns){
- chaine = chaine.replace(new RegExp(patterns[i].pattern, patterns[i].options), patterns[i].replace);
- }
| edit: maxi-grilled ---------------
Software and cathedrals are much the same - first we build them, then we pray.
|