Perl: the Markov chain saw | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
<html>
<head>
<meta http-equiv="Content-Language" content="en-us">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>New Page 1</title>
</head>
<body>
Hi all, I have what's probably a simple question, but it stumping me. I am trying to develop a multi-line regex that will look through a text file and look for any lines that start with an ipaddress, but also the next line must contain "OS Type: unknown" and then insert a carriage return in front of the line with the ip address above that. I cant insert a CR in front of just any line that starts with an ipaddress. i.e. 10.1.1.1 bogus info 10.1.1.2 this could be anything 10.1.1.3 OS Type: unknown 10.1.1.4 filler information 10.1.1.5 OS Type: unknown etc.... Any assistance would be appreciated... Thanks! </body> </html>In reply to Multiline Regex by Cosmivalin
|
|