you guys have all been a big help. I have one more question on regular expressions though. I want to make an if statement that will print out the line if a word is in the first pair of parenthesis. for example, these would print out:
1. (blah blah WORD) blah blah blah blah
2. (WORD) blah blah blah
3. blah blah blah (blah blah WORD) blah blah
but these would not:
1. (blah blah blah) blah blah (WORD)
2. (blah) (WORD)
this is what i have, but havn't gotten it to work. i'm pulling my hair trying to figure this out.
any hints or leads will be much appriciated.
thanks,
gammaman
1. (blah blah WORD) blah blah blah blah
2. (WORD) blah blah blah
3. blah blah blah (blah blah WORD) blah blah
but these would not:
1. (blah blah blah) blah blah (WORD)
2. (blah) (WORD)
this is what i have, but havn't gotten it to work. i'm pulling my hair trying to figure this out.
Code:
for ($i = 0; $i < @mylist; $i++)
{
if (@mylist[$i] =~ /([^(WORD)]*)/)
{
print "@mylist[$i]\n";
}
}
thanks,
gammaman