开发者

JSON Regex Role

i have this JSON (at the link), and i need to remove some strings from it, i'm a starter at regular expressions so i would like to know how 开发者_如何学编程to select any numbers as i put on the Regex:

http://bit.ly/qu8t4b

My pattern its that:

"[0-9]": {

But the pattern using 0-9 just give me 1,2,3,4,5,6,7,8,9 but it doesn't cover the number 12, 100, 234, and etc... someone could help me here?


I think what you are wanting is this:

"[0-9]+"

which means "the numbers zero through nine, repeated one or more times".

This allows trailing zeroes, which may be what you want, but you might prefer this instead:

"[1-9][0-9]*"

which means "a digit from one to nine, followed by a digit from zero to nine, repeated zero or more times".

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜