#!/usr/bin/perl # http://perlmonks.org/?node_id=1166246 use strict; use warnings; my $data = <<END; unwanted_line1=blabla unwanted_line2=blabla my_variable=important_content_section1 important_content_section2 important_content_section3 unwanted_line3=blabla unwanted_line4=blabla END my ($getVariable) = $data =~ /(my_variable=.*\n(?:[^=\n]*\n)*)/; print $getVariable;
In reply to Re: Multiline regex
by Anonymous Monk
in thread Multiline regex
by adrya407
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |