in reply to Matching a range of lines using a regex (the .. and ... operators)
Regards,
R.
#!/usr/local/bin/perl -w use strict; LINE: while ( <DATA> ) { $_ .= <DATA> if /<B/; next LINE if (m/\.{4}<B.*ird>/s .. /(\+\=\+)$/); print; } __END__ (Example 1) This is Example 1 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 =+=+=+=+=+=+=+=+=+=+=+
#!/usr/local/bin/perl -w use strict; LINE: while ( <DATA> ) { $_ .= <DATA> while /<(B|Bl|Blu|Blue|Blueb|Bluebi|Bluebird)$/; next LINE if (m/\.{4}<B.*ird>/s .. /(\+\=\+)$/); print; } __END__ (Example 1) This is Example 1 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 3) This is designed to break it ha ha this will make trouble<B lackCrow> This is some text....<B luebird>..MBAAAEgAAAQAoBA AAQKAREDSCETRTBDFS blaah,blaah =+=+=+=+=+=+=+=+=+=+=+
|
|---|