We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
=~
[ ]
[[..]]
[ "$input" =~ DOC[0-9]*\.txt ] && echo "match"
[[ "$input" =~ DOC[0-9]*\.txt ]] && echo "match"
=~ only works in [[ .. ]] tests. It does not work with test or [ in any shell.
[[ .. ]]
test
[
If you're targeting POSIX sh, rewrite in terms of case or grep instead.
sh
case
grep
None.