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