in reply to regex problem

If there is always going to spaces between them you might want to look at split

#an example ($title, $letter1, $num, $letter2) = split(/ /,$_);

Update: Fixed grammer error

"Cogito cogito ergo cogito sum - I think that I think, therefore I think that I am." Ambrose Bierce

Replies are listed 'Best First'.
Re: Re: regex problem
by indie_campbell (Novice) on Apr 09, 2004 at 19:26 UTC
    would this be useful if the input file had multiple entries of the example line, with other infomration embedded?
    # TITLE C 4 B INFO INFO # TITLE A 4 B
      Yes it would ...
      #an example ($title, $letter1, $num, $letter2) = split(/ /,$_) if /^# TITLE/;

      Plankton: 1% Evil, 99% Hot Gas.