[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Regular expressions and backslashes...
From: |
Juri Jensen |
Subject: |
Re: Regular expressions and backslashes... |
Date: |
Thu, 2 Aug 2001 18:29:56 +0200 |
User-agent: |
Mutt/1.2.5i |
On Thu, Aug 02, 2001 at 03:58:49PM +0200, Adrian Phillips wrote:
> >>>>> "Juri" == Juri Jensen <juri@xenux.dk> writes:
>
> [Don't forget to copy to the list so its in the archives]
>
> <snip>
>
> [ why using [[:blank:]] ]
> Juri> No, but I'm not that good at regular expressions. Are there
> Juri> any other way that I could achieve the same result...?
>
> Just write it :-
I wouldn't have expected it to be that simple ;-)
>
> BeginGroupIfNoLineMatching "^ *;* *logon path = [\][\]%N[\]USERPROFILES[\]%U(
> +(;.*)?)?$"
>
> >> - there could be several spaces around the =
>
> Juri> There isn't...
>
> In your case perhaps, I just meant in general smb.conf can have
> multiple spaces and it is normally better to be flexible to begin
> with.
That's right, I'll look into that....
>
> >> - have you a copy of the line which this should match
>
> Juri> Yes:
>
> Juri> logon path = \\%N\USERPROFILES\%U ; Edited by cfengine
>
> Oh, as in the one you are replacing it with :-)
Yes, I can see that now.... Hmm, has to change it ;-)
>
> Right, I've been testing this with perl and having lots of fun. Yes,
> it is the backslashes. Using [\] gives problems because \] is just an
> escaped ] possibly. I've tried various variations and I'm currently
> stumped although you could try [\\] to see if that helps.
Well I tried that and it didn't work....
>
> Stop the press !! I got it working using :-
>
> ^ *;* *logon path = [\\][\\]%N[\\]USERPROFILES[\\]%U( +(;.*)?)?$
>
> Try that and let me know if it works as it works using perl at least
> but I haven't checked with cfengine
It works!!! Thanks!! Fast reply and an elaborate answer, I must say...
>
> Sincerely,
>
> Adrian
>
> --
> Your mouse has moved.
> Windows NT must be restarted for the change to take effect.
> Reboot now? [OK]
>
> _______________________________________________
> Help-cfengine mailing list
> Help-cfengine@gnu.org
> http://mail.gnu.org/mailman/listinfo/help-cfengine
>
--
Med venlig hilsen/Best regards
Juri Jensen
Xenux Aps
http://www.xenux.dk
e-mail: juri@xenux.dk