X-Recipient: archive-cygwin AT delorie DOT com X-SWARE-Spam-Status: No, hits=0.7 required=5.0 tests=AWL,BAYES_40,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,TW_DF,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: sourceware.org MIME-Version: 1.0 In-Reply-To: <4CF96F70.3090507@veritech.com> References: <4CF96F70 DOT 3090507 AT veritech DOT com> Date: Fri, 3 Dec 2010 22:11:19 -0400 Message-ID: Subject: Re: Problem with Bash regex test case sensitivity From: Lee To: cygwin AT cygwin DOT com Content-Type: text/plain; charset=ISO-8859-1 X-IsSubscribed: yes Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com 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