javascript ereg?

JavaScript and client side scripting.

Moderator: General Moderators

Post Reply
wickedbob
Forum Newbie
Posts: 5
Joined: Tue Aug 06, 2002 11:22 pm

javascript ereg?

Post by wickedbob »

is there a javascript equivalent for php's ereg_replace?

BoB.
Geschi
Forum Newbie
Posts: 21
Joined: Wed Jul 10, 2002 3:21 am
Location: Germany

Yes, there is.

Post by Geschi »

If you're using Javascript 1.2 the syntax is as follows:

Code: Select all

YourString.replace(regularExpression, newSubString)
However with Javascript 1.3 there's also:

Code: Select all

Your.String.replace(regularExpression, newFunction(Arg1,Arg2...){"code"})
User avatar
Takuma
Forum Regular
Posts: 931
Joined: Sun Aug 04, 2002 10:24 am
Location: UK
Contact:

Post by Takuma »

I use Javascript 1.3, what do I use?
Post Reply