Regular Expression Case Sensitivity

Top Page
Attachments:
Message as email
+ (text/plain)
Delete this message
Reply to this message
Author: Jim
Date:  
Subject: Regular Expression Case Sensitivity
Geez, Tom - are you sure you want to move to VA? This is the best, most
concise explanation yet.

::tip of the hat::

On Tuesday 04 December 2001 14:12, you wrote:
> What you're asking it to do in regexp speak is remove all files that start
> with ZERO or more lowercase a-z characters, this would provide the desired
> result, if the shell used regexp. Bash, however, does not -- the [a-z] will
> match the first beginning character, and the * will fill in the rest.
> Running Bash 2.05.0(1)-release, this command will delete only the aaaa and
> bbbb files. Note that the .abcd file is untouched. The reason for this is
> because it starts with a single "." character, not a lowercase letter.
> (Additionally, any file that begins with a single "." character is
> considered to be a "hidden" file in the *NIX world -- to see them in an ls
> command, append -a to the command line)
>
> > When I was experimenting with this all of the files starting with *any*
> > alphabetic character were deleted. This was unexpected and I'm not sure
> > if I am misinterpreting the regular expression or if I am delusional.
> > Let me know what you get. FYI, I am using Red Hat Linux 7.2 so I would
> > be interested if it's just me.
>
> Which version of Bash are you running? (echo $BASH_VERSION)
> It might be a bug related to the older v1.xx versions of the shell -- IIRC,
> RedHat still installs v1.xx as the default shell, though I may be mistaken
> since I've not touched RH since v6.2.