Regex Character Escapes Documentation
Regex Character Escapes Documentation
Hi Void -
The regex documentation does not show any backslash escapes, but it appears that \. and \+ are implemented. Are there others? Are there any plans for more? (\\,\s and \d could be useful).
The regex documentation does not show any backslash escapes, but it appears that \. and \+ are implemented. Are there others? Are there any plans for more? (\\,\s and \d could be useful).
Re: Regex Character Escapes Documentation
Everything uses the Henry Spencer Regex Library.
This is only a POSIX regular expression implementation.
\ Escapes will only escape the next character.
You can use [[:space:]] and [[:digit:]] to match spaces and digits respectively.
I hope to add a Perl/Tcl regex implementation in a future release of Everything.
This is only a POSIX regular expression implementation.
\ Escapes will only escape the next character.
You can use [[:space:]] and [[:digit:]] to match spaces and digits respectively.
I hope to add a Perl/Tcl regex implementation in a future release of Everything.
Re: Regex Character Escapes Documentation
I can't seem to escape the closed square bracket
e.g. I have the following regex
To return non-alphanumeric filenames (that also don't have a few other little-used characters)
However, adding within my regex doesn't seem to work. Placing it immediately before the closing square bracket results in showing only files WITH square brackets in the file name. Placing it in the middle of the string results in 0 files returned (I should have things like Intel® Software Manager still returned). Placing it in the beginning, either escaped or not, returns either all files (before the second open square bracket) or 0 (after the second open square bracket). It doesn't seem to matter whether I have the second open square bracket escaped or not. I've tried double, triple and even quad-escaping the close bracket, but no options seem to work properly.
Is there a way to formulate the regexp to screen out files that are only included now because they include []?
e.g. I have the following regex
Code: Select all
([^-[_~0-9a-zA-Z '`^=!@%&$#,{}+\(\)\.])+
However, adding
Code: Select all
\]
Is there a way to formulate the regexp to screen out files that are only included now because they include []?
Re: Regex Character Escapes Documentation
https://en.wikipedia.org/wiki/Regular_expressionThe ] character can be included in a bracket expression if it is the first (after the ^) character: []abc].
For example:
([^][_~0-9a-zA-Z '`^=!@%&$#,{}+\(\)\.\-])+
Perl Compatible Regular Expressions (PCRE) have been added to Everything 1.4.
The following will also work with Everything 1.4:
regex:[^\x20-\x7f]+
Re: Regex Character Escapes Documentation
Code: Select all
regex:[^\x20-\x7f]+
([^][_~0-9a-zA-Z '`^=!@%&$#,{}+\(\)\.\-])+
With regex:[^\x20-\x7f]+, I get what I'd expect.
With ([^][_~0-9a-zA-Z '`^=!@%&$#,{}+\(\)\.\-])+, I get nothing?
XP
1.41.877
Re: Regex Character Escapes Documentation
If regex is not enabled, please make sure you search for:
regex:"([^][_~0-9a-zA-Z '`^=!@%&$#,{}+\(\)\.\-])+"
The space after Z will need to be escaped.
I get many results including a ; with the above search. Otherwise they are almost the same search.
regex:"([^][_~0-9a-zA-Z '`^=!@%&$#,{}+\(\)\.\-])+"
The space after Z will need to be escaped.
I get many results including a ; with the above search. Otherwise they are almost the same search.
Re: Regex Character Escapes Documentation
Well at least I'm getting results by quoting it.
But...
regex:[^\x20-\x7f]+, looks to be giving me "non-ASCII".
Where, ([^][_~0-9a-zA-Z '`^=!@%&$#,{}+\(\)\.\-])+, looks to be giving me non-non-ASCII, IOW, ASCII, as in the not is not negating the rest of the items?
But...
regex:[^\x20-\x7f]+, looks to be giving me "non-ASCII".
Where, ([^][_~0-9a-zA-Z '`^=!@%&$#,{}+\(\)\.\-])+, looks to be giving me non-non-ASCII, IOW, ASCII, as in the not is not negating the rest of the items?
And that would be with what, \ ?The space after Z will need to be escaped.
Re: Regex Character Escapes Documentation
If you use the regex: modifier you will need to escape any spaces with double quotes:
regex:"([^][_~0-9a-zA-Z '`^=!@%&$#,{}+\(\)\.\-])+"
Otherwise, you will be searching for:
regex:([^][_~0-9a-zA-Z AND '`^=!@%&$#,{}+\(\)\.\-])+
If you enable regex from the search menu, you can search for:
([^][_~0-9a-zA-Z '`^=!@%&$#,{}+\(\)\.\-])+
(without the regex: modifier and double quotes)
regex:"([^][_~0-9a-zA-Z '`^=!@%&$#,{}+\(\)\.\-])+"
Otherwise, you will be searching for:
regex:([^][_~0-9a-zA-Z AND '`^=!@%&$#,{}+\(\)\.\-])+
If you enable regex from the search menu, you can search for:
([^][_~0-9a-zA-Z '`^=!@%&$#,{}+\(\)\.\-])+
(without the regex: modifier and double quotes)
Re: Regex Character Escapes Documentation
thanks
with regex enabled seems to work...mostly.
Somehow 03df314e-c18c-4d6c-9b89-f5490b1b5c0b_8[1].png and a few other [1] files (that also have hyphens) in one of the following directories
still appear, as does RErth-BT+GS[016]F-C.rar in C:\Users\NameHere\Downloads
notably, neither
nor
return any results, so in addition to square brackets being a little funky and finicky, so is the hyphen (-). Escaping the hyphen in the upper "working" sample doesn't impact results. However, double- (or triple- etc) escaping hyphen suddenly returns files with double-square brackets (e.g. [[IMPORT]])
Another thing that is strange about this filter is that many entries (e.g. Name of C: and no indicated Path) are listed twice in the results.
Code: Select all
([^][-_~0-9a-zA-Z '`^=!@%&$#,{}+\(\)\.])+
Somehow 03df314e-c18c-4d6c-9b89-f5490b1b5c0b_8[1].png and a few other [1] files (that also have hyphens) in one of the following directories
- C:\Windows7.old\Users\NameHere\AppData\Local\Microsoft\Windows\Temporary Internet Files\Low\Content.IE5\Subdir
- C:\Users\NameHere\AppData\Local\Microsoft\Windows\INetCache\IE\Subdir
- C:\Users\NameHere\AppData\Local\Microsoft\Internet Explorer\DOMStore\Subdir
- C:\Users\NameHere\AppData\Local\Packages\winstore_cw5n1h2txyewy\AC\AppCache\Subdir\1or2
still appear, as does RErth-BT+GS[016]F-C.rar in C:\Users\NameHere\Downloads
notably, neither
Code: Select all
([^]-[_~0-9a-zA-Z '`^=!@%&$#,{}+\(\)\.])+
Code: Select all
([^]\-[_~0-9a-zA-Z '`^=!@%&$#,{}+\(\)\.])+
Another thing that is strange about this filter is that many entries (e.g. Name of C: and no indicated Path) are listed twice in the results.
Re: Regex Character Escapes Documentation
https://en.wikipedia.org/wiki/Regular_expressionThe - character is treated as a literal character if it is the last or the first (after the ^, if present) character within the brackets: [abc-], [-abc].
Please try:
([^][_~0-9a-zA-Z '`^=!@%&$#,{}+\(\)\.-])+