Regular expressions (Bash)

Uit De Vliegende Brigade
Naar navigatie springen Naar zoeken springen

To use regular expressions in Bash comparisons, use operator =~, like

if [[ "$switches" =~ [f] ]]; then
	echo "f - Create folder structure"
	mappenstructuur=true
fi

I have the impression that regular expressions (regex) in Bash may not be the same as in MySQL, hence some more details in this article.

See also

Sources