Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re^2: Parse variables from @output

by Corion (Pope)
on Nov 15, 2019 at 15:44 UTC ( #11108749=note: print w/replies, xml ) Need Help??


in reply to Re: Parse variables from @output
in thread Parse variables from @output

Again, compare your regular expression against the string you're trying to match, and eliminate the differences:

system image file is: bootflash:\/\/\/n5000-uk9.7.1.5.N1.1.bin +\n /^\s*system image file is:\s*"(.*)"/mi

Maybe you want to use a more interactive tool to find where your regex fails, for example haukex's interactive Perl regex tester.

Replies are listed 'Best First'.
Re^3: Parse variables from @output
by Cisco_Dave (Novice) on Nov 15, 2019 at 15:49 UTC
    Already tried that one, doesn't work I'm afraid

      Which one did you try? I didn't post any solution. I only lined up your input string with your regular expression to make it easier for you to see the differences.

      If you look closely, you might find that the regex includes double quotes while your string does not. What do the double quotes mean there?

      Sorry, with you now. Taken the quotes out, ok now just a few more to sort. Thanks again.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11108749]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (3)
As of 2021-10-20 23:56 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My first memorable Perl project was:







    Results (82 votes). Check out past polls.

    Notices?