RegExp "bug" - capitalization in filter bar

Tips on writing regular expressions for searching the post list

Moderators: Quade, dexter

RegExp "bug" - capitalization in filter bar

Postby PhileMonger » Wed Sep 18, 2002 4:19 am

regexp syntax is case sensitive, the filter bar capitalizes everything, crippling the regexp capabilities.

i.e. to find only multipart files, those with binary attachments, i would enter the following

\(\d+/\d+\)$

read: find any header that ends with an open parenth, one or more digits, whack, one or more digits and close parenth.

the cmb capitalizes the expression making it

\(\D+/\D+\)$

read: find any header that ends with an open parenth, one or more characters that are NOT digits, whack, one or more characters that are NOT digits and close parenth.

although there are work arounds for some clauses, in this case, [0-9]+ will work, but for some there are not, and without abbreviations, a lot of things are not possible.....

the regexp engine you are using is case insensitive, so i suspect the capitalization is cosmetic. any chance of changing this?

sky
salient solutions
PhileMonger
 

RE: RegExp "bug" - capitalization in filter bar

Postby dexter » Wed Sep 18, 2002 6:53 am

The \d stuff is not supported with this regex engine I believe. To do digits with our regex engine, you have to do [0-9]. So the regex to do what you want would be \([0-9]+/[0-9]+\)$ The "+" signs mean find 1 or more occurances so your original one wouldn't work when the number went to 10 or above.

Making the regex engine force to case insensitive works for 99% of the people using this feature. There are very few people over the last couple of years who have asked for case sensitivity. Unless many more request it, I doubt we'll put it in. I personally have never missed it and even when I'm coding, I usually force to case insensitive anyway.

We may be looking into another regex engine in the future that does support perl type expressions like \d and we will have to address the case sensitivity issue again at that time.
User avatar
dexter
Site Admin
Site Admin
 
Posts: 9514
Joined: Fri May 18, 2001 3:50 pm
Location: Northern Virginia, US

Registered Newsbin User since: 10/24/97

RE: RegExp "bug" - capitalization in filter bar

Postby PhileMonger » Wed Sep 18, 2002 7:35 am

thanks for the 411. i suspected as much. i guess i will just have to be creative in my expressions.

since i have you on the line..... if you look in the feature requests, a suggestion was made regarding id3 tags on mp3 files. i have found that i can read most from the first chunk. my problem is the hash. i dont seem to be getting the same digest as you when i has the message id or the subject line. what are data are you hashing? i am burning all my midnite oil on this. ;0

sky
PhileMonger
 

RE: RegExp "bug" - capitalization in filter bar

Postby dexter » Wed Sep 18, 2002 8:18 am

Ooops, you went off topic, that's Quade's area. Unless he reads this thread, it won't get answered. I'll tell him to look but you should post under tech support or something.
User avatar
dexter
Site Admin
Site Admin
 
Posts: 9514
Joined: Fri May 18, 2001 3:50 pm
Location: Northern Virginia, US

Registered Newsbin User since: 10/24/97

RE: RegExp "bug" - capitalization in filter bar

Postby PhileMonger » Wed Sep 18, 2002 8:24 am

death of thread. ;-o
PhileMonger
 


Return to Regular Expressions

Who is online

Users browsing this forum: No registered users and 23 guests