How to match full words and not substrings in Ruby

前端 未结 2 1848
有刺的猬
有刺的猬 2020-12-11 11:00

This is my code

stopwordlist = \"a|an|all\"
File.open(\'0_9.txt\').each do |line|
line.downcase!
line.gsub!( /\\b#{stopwordlist}\\b/,\'\')
File.open(\'0_9_2.         


        
2条回答
提交回复
热议问题