in reply to Matching a range of lines using a regex (the .. and ... operators)
#!/usr/bin/perl -w use strict; my $text = do { local $/; <DATA> }; # read entire file print $text; $text =~ s/<B.*?ird>[^=+]*[=+]*\B//sg; # remove unwanted stuff print $text; __DATA__ (Example 1) I have the following lines: This is some text....<Bluebird>.. MBAAAEgAAAQAB blaah,blaah =+=+=+=+=+=+=+=+=+=+=+ (Example 2) but sometimes it looks like this: This is some text....<B luebird>..MBAAAEgAAAQAoBA AAQKAREDSCETRTBDFS blaah,blaah =+=+=+=+=+=+=+=+=+=+=+
(Example 1) I have the following lines: This is some text.... (Example 2) but sometimes it looks like this: This is some text....
|
|---|