Various functions and regular expressions for Bash usage