fork download
  1. #!/bin/bash
  2.  
  3. s="foo FOOfOoFoOBARBARbarbarbAr";
  4. grep -Eo '[Ff][Oo][Oo]|BAR' <<< "$s"
  5.  
  6. grep -Po '(?i:foo)|BAR' <<< "$s"
  7.  
Success #stdin #stdout 0.01s 5504KB
stdin
Standard input is empty
stdout
foo
FOO
fOo
FoO
BAR
BAR
foo
FOO
fOo
FoO
BAR
BAR