0
我有不同的正则表达式匹配输出1)使用Rubular时和2)其他使用rails console或irb环境时。异常在正则表达式输出
1)Rubular
/\w+/ on test string "---\n- nicidnut\n" matches " n nicidnut n"
(I have shown only matched part and put spaces for unmatched string characters)
2)IRB
(/\w+/).match("---\n- nicidnut\n") produces "nicidnut".
我不明白为什么会出现两个不同的输出和我缺少什么?
非常感谢。它帮助:) – shailesh