blob: 9274766716f8432ca6b22afff17915d96630ecc2 [file] [log] [blame]
# regex should accept '+' operator
[[ abcdef =~ a[b-z]+ ]]; echo 1:YES:$?
# newline matches by "match any" patterns
v='
'
[[ "$v" =~ . ]]; echo 2:YES:$?
[[ "$v" =~ "[$v]" ]]; echo 3:no:$? # hmm bash does return 1... why?
[[ "$v" =~ [^a] ]]; echo 4:YES:$?
# should work even without quotes:
[[ $v =~ . ]]; echo 2u:YES:$?
[[ $v =~ [$v] ]]; echo 3u:YES:$?
[[ $v =~ [^a] ]]; echo 4u:YES:$?