Re: Need help with a REGEX

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View
Michael R. McPherson Pierotti wrote:

Quoted text here. Click to load it

$line =~ /\d/ isn't assigning a value.  Did you want to drop the digits
or catpure them?  I assume capture them.

You said you want to pull them out, did you mean just the "950" match or
other digits on the next lines, too?

Assuming you want the one in question:

my $digits = 0;
if ($RIR[$n] =~ m/^TREE=\s+(\d+)\s+/) {
 $digits = $1;
 # last; ??

You might want to do the match and then assign it and then do a last to
break out of the loop once you get the data you want.  If you needed
something else than the above example, please clarify.
Tim Greer, CEO/Founder/CTO,, Inc.
Shared Hosting, Reseller Hosting, Dedicated & Semi-Dedicated servers
and Custom Hosting.  24/7 support, 30 day guarantee, secure servers.
Industry's most experienced staff! -- Web Hosting With Muscle!

Re: Need help with a REGEX

Quoted text here. Click to load it


That's exactly what I was looking for :) I need to pull those digits so I
can run a seperate telnet command just on theose TREE numbers from the first



Site Timeline