in reply to Multiline Regex
Asumming I've understood your question correctly, something like the following?
#!/usr/bin/perl -w use strict; my $data = join '', <DATA>; $data =~ s|(?=^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\nOS Type: unknown$)| +\n|gm; print $data; exit(1); __DATA__ 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
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Re: Multiline Regex
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 |
In Section
Seekers of Perl Wisdom