I was experimenting with Character Classes because they were covered in MySQL Crash Course. There are probably substitutes for all the character classes--such as ^[a-z] for [:lower:]--that I probably should stick with instead of wandering off into foreign territory.
Fooling with Character Classes did pay off, however, because I heard about COLLATE and declaring columns as binary from other responses. On Wed, 2007-05-02 at 08:08 -0400, [EMAIL PROTECTED] wrote: > > Wouldn't the regular expression be ^[a-z].* > > ^ = start of string > [ a-z] = class range for lower case > . = any character > * = mods last to grab anything after that... > > > actually you should just be able to get by with ^[a-z] > > > > John Kebbel > <[EMAIL PROTECTED]> > > 05/02/2007 05:33 AM > Please respond to > [EMAIL PROTECTED] > > > > > To > MySQL > <mysql@lists.mysql.com> > cc > > Subject > Re: REGEXP > Character Classes > > > > > > > > > I went to the MySQL documentation pages and read up on using COLLATE. > I > knew SELECT was case-insensitive, but I was sort of surprised that > using > a character class didn't override that. Anyway, I next tried the > "status" command to see if it gave me any characterset information. > > Client characterset: latin1 > Server characterset: latin1 > > Once I thought I understood what was going on with COLLATE and case > sensitivity, I tried this command... > > SELECT id, pswd, division, department, title, classification FROM > pswds > WHERE pswd REGEXP '[:lower:]' COLLATE latin1_bin; > > It seemed to work fine. I searched the column to see if I could find > any > instances of all caps value, but did not find any. (They do exist; I > created the data for this table from a Perl script solely to practice > using character class regular expressions.) > > Then I tried this command. It should not have found any instances of > all > lower case passwords, but it did. > > SELECT id, pswd, division, department, title, classification FROM > pswds > WHERE pswd REGEXP '[:upper:]' COLLATE latin1_bin; > +------+----------+------------------+------------+------------+----------------+ > | id | pswd | division | department | title | > classification | > +------+----------+------------------+------------+------------+----------------+ > | 8 | euwsrbwm | Customer Service | Accounting | Clerical | > 0f1b12 > | > | 13 | mejccvoz | Customer Service | Receiving | Clerical | > 437113 > | > | 18 | kwkheprh | Customer Service | Purchasing | Clerical | 29652 > | > | 20 | qpvxvqhz | Customer Service | Accounting | Clerical | > bcb244 > | > > > Is there something obvious that I'm missing here? > > > -- > MySQL General Mailing List > For list archives: http://lists.mysql.com/mysql > To unsubscribe: > http://lists.mysql.com/[EMAIL PROTECTED] > -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]