新手问题 问个简单的正则

lin_style · August 12, 2012 · Last by lin_style replied at August 12, 2012 · 1811 hits

teststr = "[email protected]" puts /[^@]/.match(teststr)

为什么输出 d ,而不是 dfas??

我在 http://www.rubular.com/ 这个网站测试又都显示对的选择

puts /[^@]+/.match(teststr)`

#1 楼 @AlphaLiu 多谢。。刚在瞎试试出来了。。

You need to Sign in before reply, if you don't have an account, please Sign up first.