#!/bin/bash # t_regex: Tutorial on regex, test # By Lee Rothstein, 2010-12-04, 13:57:54 # Each Test performed on: # * CYGWIN_NT-6.0-WOW64 1.7.7(0.230/5/3) # * Linux 2.6.15-55-amd64-generic #if [[ "$1" =~ [A-Z] ]] ; then # doesn't work if [[ "$1" =~ [:upper:] ]] ; then # doesn't work #if [[ "$1" =~ [ABCDEFGHIJKLMNOPQRSTUVWXYZ] ]] ; then # Works echo Contains Capital Letters: $1 else echo Doesn\'t Contain Capital Letters: $1 fi