开发者

RegExp to get any number + `;#`?

I have several numbers in a string, such as:

8;#
10;#
34;#
etc...

I wanted to erase all of these from the string, so was thinking RegExp would be my best option.

What regexp expres开发者_运维技巧sion do I use that will identify any series of numbers followed by ;# ?


Try something like this this:

\d+;#

I don't know AS3 but I think your code should look something like this:

var r:RegExp = /\d+;#/;
var s:String = "foo 8;# bar 10;#baz 34;#   bah";
var x:String = s.replace(r, "")
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜