I would like to group expressions with () in case
, like so:
case a in
'*(a|b)*') printf '%s\n' 'something something';;
esac
This has not yielded any success though. I have also tried:
*(a|b)*
*'('a|b')'*
None of which I had success with.
You can convert to the basic pattern matching as shown below:
case 'a' in
*a*|*b*) printf '%s\n' 'something something';;
esac
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With