0

I need to match only a-z 0-9 and spaces between words and numbers. I try with [a-z0-9\s] but with this regex I match \n \t and \r.

I try with this: http://regexr.com?30rs7 but I don't know is this code work correctly and I ask about the correct regexp :)

Regards, George!

4

3 回答 3

1

从字面上理解:

[a-z0-9 ]

空格而不是\s与您不想匹配的其他人匹配。

于 2012-05-04T22:55:43.077 回答
1

怎么样[a-z0-9 ]

那应该这样做。

于 2012-05-04T22:56:18.103 回答
0

我在您的情况下使用的正则表达式是这样的:

[a-zA-Z0-9 ]
于 2012-05-04T22:57:40.857 回答