#!/bin/bash s="foo FOOfOoFoOBARBARbarbarbAr";grep -Eo '[Ff][Oo][Oo]|BAR' <<< "$s" grep -Po '(?i:foo)|BAR' <<< "$s"
Standard input is empty
foo FOO fOo FoO BAR BAR foo FOO fOo FoO BAR BAR
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!