Hi there,
I have written a regular expression to convert ‘&’ into ‘and’. however it only changes the first occurance of ‘&’ not all of them.
this is my first time using reg ex so I would love any help whatsoever
NB: this is a JavaScript Function
function tidyD(h){
h = h.replace(/(\/?)&([^>]*)/gi, "$1and$2");
return h;
}
eg:
[COLOR=DarkSlateBlue]apples & oranges & pears [/COLOR]
would become
[COLOR=DarkSlateBlue]apples and oranges & pears [/COLOR]
8-]