This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Problem with Bash regex test case sensitivity


On 12/3/10, Lee Rothstein   wrote:
> Having some problems with bash case-sensitive regexes, so I wrote
> this little test.
   ... snip ...
> Do I have some Bash or Cygwin parameter set that engenders case
> insensitivity?

Probably the same thing I ran into with LANG != C
try this little test:

$ cat t_regex
#!/bin/bash
# t_regex: Test test regex
# By Lee Rothstein, 2010-12-03, 16:27:38

regex_test () {
if [[ "$1" =~ [A-Z] ]] ; then
   echo Contains Capital Letters: $1
else
   echo Doesn\'t Contain Capital Letters: $1
fi
}

export LANG="C.UTF-8"
regex_test dfgh

export LANG="en_US.UTF-8"
regex_test dfgh


 ~/src
$ ./t_regex
Doesn't Contain Capital Letters: dfgh
Contains Capital Letters: dfgh


> Or, is this a bug?

Welcome to the new world order :-0   I tried to figure out why the
collating sequence changes with the language settings but didn't get
anywhere beyond the fact that it _does_ change.  Oh well.. try, try
again.

Regards,
Lee

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]