On 11-11-04 01:42 PM, Chris Stinemetz wrote:
I am trying to match a line that has HEH in it.

I would also like to store the number follow CELL in memory variable $1
and store everything following the number and upto excluding ", HEH" in
memory variable $2

so this line:

Cell 999 CDM 1, 2, CBR 1, 15MHz, HEH
will equal:

$1 = 999
$2 = CDM 1, 2, CBR 1, 15MHz

Thank you in advance.


Try:

m{       # start of match
  \b     # word boundary
  Cell   # word 'Cell'
  \s*    # optional white space
  (\d+)  # cell number as $1
  \s*    # optional white space
  (.*)   # data as $2
  \,     # comma
  \s*    # optional whitespace
  HEH    # word 'HEH'
  \b     # word boundary
}msx     # end of match


--
Just my 0.00000002 million dollars worth,
  Shawn

Confusion is the first step of understanding.

Programming is as much about organization and communication
as it is about coding.

The secret to great software:  Fail early & often.

Eliminate software piracy:  use only FLOSS.

"Make something worthwhile."  -- Dear Hunter

--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/


Reply via email to