6608Re: RegEx Help for Find in Files
- Dec 2, 2010--- In email@example.com, DZ-Jay <dz@...> wrote:
> On 12/02/2010 08:56, omcmiami wrote:
> > I'm trying to find the correct Regular Expression to use (actually
> > exclude) files when using the the "Find in Files" search utility.
> > I have a VERY large number of backup files that have been renamed as such:
> > header-2010-08-16.htm
> > header_a-2009-06-29.inc
> > header-2010-06-24.tpl
> > I'm trying to exclude these files when doing a "Find in Files" search.
> > I've been unable to write a usable RegEx to exclude files named in this
> > manner - namely, any file with ####-##-## in the file name. Since
> > nothing I've tried seems to work, I'm not even sure RegEx's can be used
> > in the EXCLUDE field.
> > Can you use a RegEx in the Exclude field of "Find in Files"?
> > If so, any ideas on a proper RegEx to exclude ####-##-##?
> > Thank you in advance...
> You are right, the "Exclude" field in the "Find in Files" window only
> accepts DOS file name "globbing" patterns, which are very limited. Just
> in case, below is a reference to the pattern matching rules for DOS:
> '*' Matches zero or more characters, except a '.'
> '?' Matches any single character
> '.' Matches a literal '.'
> To exclude files with the patterns you mentioned, you can try something
> However, this will not do exactly what you expect. keep in mind that
> "?" stands for "any character," not just a digit. That pattern will
> then exclude anything that has "four characters, followed by dash,
> followed by two characters, followed by a dash, followed by two more
> characters, followed by the extension." In will exclude,
> "header-2010-08-016.htm", but it will also exclude "fred-01-foo.htm".
> Unfortunately, this is as good as it gets with the EditPlus built-in
> search. For more elaborate searches, you may want to try a dedicated
> searching tool, like Agent Ransack, which is free:
That's what I thought after repeated RegEx's got ignored.
Thanks VERY much for your help!
- << Previous post in topic