View Single Post
Old 11-25-2017, 03:54 PM   #5
calmeilles
Junior Member
calmeilles began at the beginning.
 
Posts: 5
Karma: 10
Join Date: Nov 2017
Device: Kindle
Quote:
Originally Posted by jackie_w View Post
... or perhaps it's designed to be more user-friendly for those with little or no experience of regex flags.
Okay, I've given that some thought.

I don't think that anyone who had encountered regexes before would expect them to ignore case; it's one of the first things you learn about them — they're precise (often in frustrating and unexpected ways, but that's a different subject).

Anyone not familiar with them, trying them out with the help of the documentation would read right at the beginning
Quote:
You’ll notice, though, that this only matches the exact string "Hello, World!", not e.g. "Hello, wOrld!" or "hello, world!" or any other such variation.
And further down:
Quote:
Knew you’d ask. Some useful sets are [0-9] matching a single number, [a-z] matching a single lowercase letter, [A-Z] matching a single uppercase letter, [a-zA-Z] matching a single letter and [a-zA-Z0-9] matching a single letter or number.
This is written to show that case matters. Otherwise in the above [a-z] would be sufficient to match a-z and A-Z.

Further on still we come to the part that shows how to flag ignore case
Quote:
In the beginning, you said there was a way to make a regular expression case insensitive?
Yes, I did, thanks for paying attention and reminding me. You can tell calibre how you want certain things handled by using something called flags. You include flags in your expression by using the special construct (?flags go here) where, obviously, you’d replace “flags go here” with the specific flags you want. For ignoring case, the flag is i, thus you include (?i) in your expression. Thus, (?i)test would match “Test”, “tEst”, “TEst” and any case variation you could think of.
Again, written from the perspective that case sensitivity is the norm.

So I still feel that adding the reverse syntax would be nice.

Mentioning the check-box and its effect at this point could also do users — new and experienced — a favour. The check-box only gets referenced once, right at the end under "Bulk editing metadata" which I skipped as I wasn't bulk editing metadata.

It's not as if I were suggesting a radical change in the application itself; just that a few words be added to documentation.
calmeilles is offline   Reply With Quote