|
From: Ed R. <er...@pa...> - 2002-03-15 19:55:55
|
RGi...@a1... writes:
>
> > > > pattern #1: -re `^cs3mc-lab-e0a(\\(\S+\))?#'? No.
> > > ^^ ^
> > > Hmm, this is interesting. Two backslashes in one spot, one
> > > in the next.
>
> Looks like a glitch in Perl to me. And the "\012" is also fishy.
> What system is the user running on?
Red Hat 7.2, Perl 5.6.0. And I saw the same thing with Red Hat 6.2,
Perl 5.6.1. Haven't tried NetBSD and perl 5.6.x yet.
> I'd try to fiddle with the regexp: qr"\b$routername(?:\(\S+\))?#"
> should work as well, or qr"$routername(?:\(\S+\))?#\Z".
Well, that's something like what I suggested to the user, and he says
it's working now - instead of
$router_prompt= '^' . $routername . '(\(\S+\))?#';
He deleted the '^' and simplifed the right match pattern. Hopefully
he'll send me the exact code so I'll get a better idea of what works.
I don't like deleting the anchoring to the beginning of the line, since
it might get an accidental match with comments or other arbitrary
strings in the router's config.
> > > > However, the big difference between the early commands
> > > > that matched and the one that failed is that the latter
> > produces hundreds
> > > > of lines of output
> Have you set $exp->match_max?
My script by default sets it to 256k, and the user can specify it
on the command line. And if I was overrunning the accumulator,
wouldn't I just lose the beginning of the data I want rather than
not match the end?
Hopefully a few more people will start using the script and I'll
get some more feedback. Very strange...
|