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) -

xcode - Swift Playground - Files are not readable -

windows - How to automate a file conversion xwm to mp3 with xwmaencode.exe using bat file -