Regex in Perl

Any questions involving matching text strings to patterns - the pattern is called a "regular expression."

Moderator: General Moderators

Post Reply
User avatar
legend986
Forum Contributor
Posts: 258
Joined: Sun Jul 15, 2007 2:45 pm

Regex in Perl

Post 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?
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Re: Regex in Perl

Post 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.
Post Reply