Front page | perl.beginners |
Postings from March 2003
Re: substring problems
Thread Previous
|
Thread Next
From:
Wiggins d'Anconia
Date:
March 19, 2003 15:14
Subject:
Re: substring problems
Message ID:
3E78F95B.4020306@danconia.org
tao wang wrote:
> thanks a lot. But there is one problem - this is my
> fault. The KEY1, KEY2 don't exactly look like this.
> There are six KEYS. Three are related to KEYS, but the
> rest of them are A_BEG A_END, B_OPTIONS, and I need to
> extract information between them. I used one variable
> $op=KEY1|KEY2|KEY3|A_BEG|A_END|B_OPTIONS to store all
> the alternatives, and tried to use
>
> my @values = $line =~ /$op.*$op/g;
>
> But didn't work as i expected. Are there any
> problems. please help me with it. thanks again.
>
Are they always ordered in the above manner or is it possible for
B_OPTIONS to occur before KEY3, etc.??
>>>
>>> The line might be one of the following:
>>> KEY1 3 4 T KEY2
>>>
>>> KEY1 3 4 T KEY2 456 67 KEY3
>>>
>>> KEY1 3 4 T KEY2 456 67 KEY3
>>>
http://danconia.org
Thread Previous
|
Thread Next