in reply to old Perl regex problem
How about dividing the problem into two regexes?
while (<>) { chomp; next if (/(H|IF)-000$/ or !/^PH/); print "$_\n"; }
Second thought: I just noticed that your description and your regexes differ, so I'm not sure whether you want to match IF-000 or I-000. If you want the latter, use
next if (/[HI]-000$/ or !/^PH/);
But I guess that's obvious.
|
|---|