如何在 ruby 1.8 中执行匹配的正则表达式:
/my_dir/1/file
但如果我有:
/my_dir/1/deeper_stuff/file
到目前为止我有
source_string = '/my_dir/1/index.html.erb'
/^\/my_dir/.match(source_string)
对于初始比赛,我如何添加第二个取消资格/deeper_stuff
?
以便
source_string = '/my_dir/1/deeper_stuff/'
被排除在外。