regex - how to do "or" in substring matching for bash -


echo `expr "hello" : '\(hi|hello\)'` echo `expr "hi" : '\(hi|hello\)'` 

obviously i'm trying match "hello" , "hi" regex hello , hi, neither matches.

how express properly??

alternately, plain globs

case $str in     *hi* | *hello*) echo "pleased meet you" esac 

Comments

Popular posts from this blog

c++ - QTextObjectInterface with Qml TextEdit (QQuickTextEdit) -

javascript - angular ng-required radio button not toggling required off in firefox 33, OK in chrome -

xcode - Swift Playground - Files are not readable -