regex + sbackup
dave s
ubuntu at pusspaws.net
Wed Feb 15 04:03:04 UTC 2006
On Wednesday 15 Feb 2006 02:02, Darryl Clarke wrote:
> On 14/02/06, dave s <ubuntu at pusspaws.net> wrote:
> > On Tuesday 14 Feb 2006 23:05, Darryl Clarke wrote:
> > > On 14/02/06, dave s <ubuntu at pusspaws.net> wrote:
> > > > > > > /home/[^/]+?/\.thumbnails
> > > > > >
> > > > > > /home/dave/test/^data$
> > > > >
> > > > > /home/[^/]+?/\data
> > > >
> > > > /home/dave/test/[^/]+?/\data
> > >
> > > [snipped a bunch of stuff]
> > >
> > > In the first example the \.thumbnails the \ is escaping the . in
> > > .thumbnails it is not required in the samples that include data.
> > >
> > > /home/dave/test/[^/]+?/data
> > >
> > > should be the proper regex.
> > >
> > > --
> > > ~ Darryl ~ smartssa at gmail.com
> > > ~ http://darrylclarke.com
> >
> > I see your point, tried
> >
> > /home/dave/test/[^/]+?/data
> >
> > unfortunately same problem, not excluded
>
> Wait, is the data path:
> /home/dave/test/something/data
> or
> /home/dave/test/data?
Yep Its this one
>
> If it's the second, it's no wonder it didn't work ;)
>
> try:
> /home/dave/[^/]+?/data
:) that works !
>
> this will exclude
> /home/dave/[anything]/data
> but not
> /home/dave/data
> or
> /home/dave/[anything]/[something]/data
>
because [^/]+?/ replaces one element in the path :)
> I think this:
> /home/dave/[.]+?/data
>
> should exclude
> /home/dave/[anything/including/subfolders]/data
>
> but still not
> /home/dave/data
>
I see what you are saying
> I don't think you're experiencing a bug, just some regex trickery.
>
This regex stuff is a dark art. I got the path thing now and it works ( a big
thank you :)) but I still have one last regex problem.
/home/dave/[^/]+?/data
excludes the data directorys but also my 'data_process' directories :( I
changed my regex to
/home/dave/[^/]+?/data$
to try and only exclude 'data' directories but all it did was allow both data
and data_process directories.
...mmm...
any ideas on this last one ?
Dave
More information about the ubuntu-users
mailing list