Ruby Regexp example for filter files


/ Published in: Ruby
Save to your folder(s)



Copy this code and paste it in your HTML
  1. list = Dir.entries(@fullpath2images)
  2.  
  3. for l in list
  4. if /^plan_#{params[:id]}_(sm|big)_.*/ =~l
  5. File.delete(l)
  6. end
  7. end

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.