admin wrote:
Concerning the critique of my proposal: I see your points, but all the potential problems you mentioned pertain just as well to Boolean combinations of non-regexp patterns and are solved since long: you escape stuff using \.
So I will just add the little extra I mentioned and we'll see how it works out in real world file searching.
I'm not saying that there aren't always issues - but it seems like this method is going to cause some unnecessary issues and complications. Searching for files like "2008-12-03 OR Surgical supply List.doc", might involve a RegEx such as "\d{4}-\d{1,2}-\d{1,2} OR". It seems to me that it would be a lot less complicated, not to mention easier to read if this RegEx was surrounded by delineators as opposed to what you're proposing.
For example:
Code: Select all
"\d{4}-\d{1,2}-\d{1,2} OR" AND "Pattern 2"
vs.
Code: Select all
\d{4}-\d{1,2}-\d{1,2} OR AND Pattern 2
What you're proposing would now require escaping entire words, which complicates the RegEx unnecessarily, and would make readability a nightmare in certain circumstances.
Plus, it makes RegEx a nightmare in general. You're suggesting that if you want to include the word "AND" in your search pattern, that you type it as "\AND". But in RegEx, "\A" and "\a" have special meanings, so are you using an escaped boolean word, or are you referring to a RegEx "\A" or "\a" followed by an "ND"?
On the other hand, if you clearly seperate the RegEx statements, most of these issues go away. For example, if you defaulted XY to use "**" as the delineator - it's *really* unlikely that this pattern of the double asterisk would be used in RegEx for XY. It might be used for RegEx in general, but because XY is a file manager, and the asterisk is an illegal character for file names, you're pretty safe for the majority of possible cases. And for those exceptions, a person can edit the INI file and change it appropriately.