![]() |
|
good chemistry is complicated, and a little bit messy -LW |
|
PerlMonks |
String parsingby hotshot (Prior) |
on Jan 05, 2004 at 10:22 UTC ( #318803=perlquestion: print w/replies, xml ) | Need Help?? |
hotshot has asked for the wisdom of the Perl Monks concerning the following question:
Hello all! I have a variable that can hold one of the followings strings: These strings are output generated from a script I run. As you can see, the first word is the status itself, in the forst parenthesis (before the colon) is the exit status, that not always exist, and after the colon is a string with variables in parenthesis. I need to extract the status, exit status (if exists), and variables (if exists), and print to display a new string with placeholders for the variables taken from the output above. How can I easily extract all I need from the string outputed by the script (a regexp or something), I need at the end an array holding the status followed by the exit status in the first entry (for example: OFF, ERROR2, WARNING1), and the variables in the next entries, for example: Anyone?
Back to
Seekers of Perl Wisdom
|
|