Cosmivalin has asked for the wisdom of the Perl Monks concerning the following question:
<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>
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Multiline Regex
by kilinrax (Deacon) on Feb 15, 2001 at 23:37 UTC | |
by InfiniteSilence (Curate) on Feb 16, 2001 at 01:18 UTC | |
by the_slycer (Chaplain) on Feb 16, 2001 at 09:09 UTC | |
by kilinrax (Deacon) on Feb 16, 2001 at 20:54 UTC |
Back to
Seekers of Perl Wisdom