cspctec has asked for the wisdom of the Perl Monks concerning the following question:
And I need a regex that will match "Controller Status", "Status of logical device", and "Power State", but not "NCQ Status" or "Supported Power State".Controller Status: Optimal NCQ status: Enabled Status of logical device: Optimal Power State: RPM Supported Power State: RPM, Powered off
I have my regex set up like this:
That is matching everything. I tried something like this as well:my $match = 'status|power'; foreach (@data) { if (/$match/i) { print $_; } }
I thought the ^ncq meant do not match.my $match = '[^ncq]status|[^supported]power';
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Help with my regex
by toolic (Bishop) on Jul 31, 2013 at 20:44 UTC | |
|
Re: Help with my regex
by SuicideJunkie (Vicar) on Jul 31, 2013 at 20:54 UTC | |
by cspctec (Sexton) on Jul 31, 2013 at 21:13 UTC | |
by Preceptor (Deacon) on Jul 31, 2013 at 21:25 UTC | |
by SuicideJunkie (Vicar) on Jul 31, 2013 at 21:36 UTC | |
|
Re: Help with my regex
by Laurent_R (Canon) on Jul 31, 2013 at 21:51 UTC | |
|
Re: Help with my regex
by moritz (Cardinal) on Aug 01, 2013 at 05:38 UTC |