开发者

How to convert the replace() javascript regex function to actionscript?

开发者 https://www.devze.com 2023-01-14 07:42 出处:网络
Both JS and AS3 implement RegEx as defined in the ECMAScript edition 3 language specification (ECMA-262).

Both JS and AS3 implement RegEx as defined in the ECMAScript edition 3 language specification (ECMA-262).

Although I may not have any trouble converting the regular expressions themselves, in javascript I see the string.replace() f开发者_开发百科unction used.

AS3 only has exec() and test(), are they equivalent to replace()?


AS3 has String.replace() -- the very link you mentioned. Any problems with this function?


String.replace(), as you'd expect.

It's a member of the String object, just like in JavaScript. exec() and test() are members of the RegExp object, just like in JavaScript.

0

精彩评论

暂无评论...
验证码 换一张
取 消