开发者

how to convert ECMA-262(ActionScript3.0) RegularExpression to ICU(Objective-C) RegularExpression?

开发者 https://www.devze.com 2023-03-11 04:58 出处:网络
Now, I something doing about parse work. I want to use actionscript3.0 RegularExpression开发者_JAVA技巧 source code to Objective-C program.

Now, I something doing about parse work.

I want to use actionscript3.0 RegularExpression开发者_JAVA技巧 source code to Objective-C program.

var reg:RegExp = new RegExp("^[0-9]+$", "gm");

how to convert NSRegularExpression?

p.s: ActionScript 3.0 implements regular expressions as defined in the ECMAScript edition 3 language specification.

thk.


Check how you use regexes in objective-c, reuse the pattern ^[0-9]+$ (btw. you can rewrite it to ^\d+$). You need also to activate the modifiers g (global match ==> matches all occurences) and m (multiline, makes the $ matches on line ends instead of string end).

0

精彩评论

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