From: Ahmad Azizan Date: 2009-10-28T14:24:38+09:00 Subject: Is it possible to do multiple regex in one operation? Hello, I'm trying to grep some of the content from a file which contains character ; or { or } or "while" or "function" in shell, it similar to; cat file.txt | grep -e ";" -e "{" -e "}" -e "while" -e "function I've tried to use operation like below; output.each {|f| puts f if f =~ /[;{}]/} however, I failed to add another 2 keyword which are "while" and "function" I was wonder if multiple regex can be evaluate in one operation like /[;{}]/,/while/,/function/ or /[;{}]/ || /while/ || /function/ or any other forms Thanks in advance Ahmad Azizan, -- Posted via http://www.ruby-forum.com/.