Last updated 9 months ago
In BASH we can perform regular expression on a string using =~ operator, example is given below -
=~
[[ "string" =~ pattern ]]
$ if [[ "Hello" =~ "1" ]]; then echo "True"; else echo "False"; fi False
Source: