Hello,
I am trying to understand the regex capabilities of Everything, and would like help understanding the following:
If I enter "\.tlb" (obviously without the quotes) I have returned a list of files which does appear to be all of the type libraries on my system.
I note in the results that I have a number of them which begin with the letter f.
I modify my regex to "f+\.tlb" (which I believe should be these same type libraries, just beginning with the letter f) and now I have zero results.
I have looked under help and the regex syntax, and it appears that I am using your particular flavor of regex correctly to accomplish what I want.
Is there something that I am not understanding correctly about this process?
Thank you,
Michael
RegEx Search
Re: RegEx Search
Your regex leads to: search for one or more letter f followed by literal . (dot) followed by literal tlb.
try ^f.*\.tlb (begin with f followed by any character any times followed by literal .tlb)
Try online regex tester/learning www.regex101.com
try ^f.*\.tlb (begin with f followed by any character any times followed by literal .tlb)
Try online regex tester/learning www.regex101.com
Re: RegEx Search
Alternately, you can leave Regex Search turned off, and use one or more patterns in your search using the regex: prefix.
regex:^f regex:\.tlb$
regex:^f .tlb
regex:^f.*\.tlb$
I'm not sure about all the edge cases like supporting space characters in the regex pattern. Think maybe optional /pattern/ quoting support should be added to explicit the beginning and end of a pattern, and enable modifier support.
Match Path has to be turned off to support anchors at filename boundaries.
regex:^f regex:\.tlb$
regex:^f .tlb
regex:^f.*\.tlb$
I'm not sure about all the edge cases like supporting space characters in the regex pattern. Think maybe optional /pattern/ quoting support should be added to explicit the beginning and end of a pattern, and enable modifier support.
Match Path has to be turned off to support anchors at filename boundaries.
Re: RegEx Search
Enclose the regular expression in double quotes or use \s instead of a space.
For example to find "c:\Program Files", use:
regex:"ram files$"
regex:ram\sfiles$
Otherwise a space will be seen as the end of the regular expression.
Note:
- Regular expressions in Everything are case-insensitive. That is different from most other regex engines.
If you want to do a case-sensitive search, add the case: modifier to your query. Example:
case: regex:"ram Files$"
- or -
Enable Match Case (Menu:Search > Match Case ) - Everything uses the PCRE (Perl Compatible Regular Expression) engine.
What do you mean by that?
Re: RegEx Search
When you have Match Path (Ctrl+U) enabled, PCRE only sees the entire full path of every file, but does not (also) see just the filename. This means that your use of anchors (ie. ^ and $) will be bound against the full paths. When you disable Match Path, then PCRE only sees the filenames. This will change the behavior of the ^ anchor: either leading the drive letter, or leading the first character of the filename.
Seems like you can also use most PCRE in-pattern modifiers, such as (?i) and (?-i) for selective case-insensitive and case-sensitive matches.
regex:"(?-i)\.Exe$"
Re: RegEx Search
Ah, now it's clear. Thanks!
Re: RegEx Search
Very good explanation as to why I was not getting my expected results. Thank you.