Excluding text in Perl
Good morning,
I have a variable, $data, wich contains text (with lines, paragraphs, etc.). How can I exclude a portion of the text beggining with some words and ending at another? I've triesd: Code:
$data =~ s/First words(.*|\r|\n)last words//gmi; Any ideas? Regards, Rigel_Kent |
well i'd suggest takign the two parts either side and joining them together afterwards.
$data =~ /^(.*)start.*end(.*)$/; echo $1 . $2; should work ok save for my probable syntax errors. |
try
Code:
$data =~ s/First words.*?last words//gsi; |
Doesn't work...it should.
Regards, Rigel Kent |
Correction: it works !!!
Thanks, Rigel_Kent |
All times are GMT -5. The time now is 06:52 PM. |