Page 1 of 1

Regex in Perl

Posted: Tue Feb 26, 2008 12:50 am
by legend986
I know this is a PHP forum but somehow thought Regex is same no matter where. I am trying to read a file and capture particular lines into different strings:

Code: Select all

 
LENGTH: Some Content here
 
TEXT: Some Content Here
 
COMMENT: Some Content Here
 
I want to be able to get (LENGTH: .... ) into one array and so on... I'm trying to use PERL in slurp mode but for some reason I'm having trouble. Can someone suggest me a better way?

Re: Regex in Perl

Posted: Sat Mar 01, 2008 6:10 am
by Chris Corbyn
Could you post an example of the code you're trying, along with an example of the output you expect? I know a little perl.