Can't figure out the Regex syntax

If you are experiencing problems with "Everything", post here for assistance.
Post Reply
dedupeit
Posts: 29
Joined: Thu Jul 28, 2022 9:52 pm

Can't figure out the Regex syntax

Post by dedupeit »

I have a filename such as "2019-07-13 21 54 22 - something - notes.txt"

I'm trying to just get "notes.txt" out of this. The following regex pattern should match the rest of the string outside of "notes.txt"

Code: Select all

\d{4}-\d{2}-\d{2}.*\s
I've tested this at https://regex101.com and it works for every flavor of regex that they have listed. In Everything, I use this formula which should match everything but "notes.txt" and then replace it with nothing (leaving just "notes.txt") but it doesn't match and therefore the result is the original filename.

Code: Select all

a:=regexreplace(name:,\d{4}-\d{2}-\d{2}.*\s)
Hyphens seem to be an issue so replacing those with periods (as a temporary workaround) at least matches something, but instead of matching everything to the last space it stops at the first space.

Code: Select all

a:=regexreplace(name:,\d{4}.\d{2}.\d{2}.*\s)
I've also tried using regexextract to capture anything that's not whitespace at the end of the string. I'm a frequent users of regular expressions in general and nothing seems to make sense when I'm trying to use it in Everything. I'm sure I'm just missing some Everything specific syntax or something like that but don't know where to find that.

Running 1.5.0.1384a
dedupeit
Posts: 29
Joined: Thu Jul 28, 2022 9:52 pm

Re: Can't figure out the Regex syntax

Post by dedupeit »

And figured it out :roll: (rolling my eyes at myself for not figuring this out before posting)

Need to enclose the regex pattern in quotes so that Everything doesn't process some of the characters in advance of the regex evaluation
Post Reply