ruby语言的BUG
程序员文章站
2022-07-15 11:51:52
...
mystr = "我爱fd--xbsk伙 d--d 与天2载--r user--fd" if /--([bxsrgylh]{1,3})(.*)--/ =~ mystr puts $1 puts $2 g = "<span style='" $1.split('').each do |vv| puts vv end puts $2 puts g # g += "'>" + $2 + "</span>" # mystr = mystr.sub($&, g) end puts '----over' puts mystr
$2 is null.It is a bug.If I comment
$1.split('').each do |vv| puts vv end
$2 is OK
gogogo
上一篇: heroku显示详细日志的方法
下一篇: Rickson Gracie vedio