is there a javascript equivalent for php's ereg_replace?
BoB.
javascript ereg?
Moderator: General Moderators
Yes, there is.
If you're using Javascript 1.2 the syntax is as follows:
However with Javascript 1.3 there's also:
Code: Select all
YourString.replace(regularExpression, newSubString)Code: Select all
Your.String.replace(regularExpression, newFunction(Arg1,Arg2...){"code"})