bobg2011 has asked for the wisdom of the Perl Monks concerning the following question:
Hi I have a perl regexp question for something I've been struggling with.
Basically I have a file that I wish to match on a particular string
I want to be able to match on 'Servername SERVERNAME' ,where Servername is a constant string and SERVERNAME is variable.
So I want to match on
'Servername myserver'
OR
'Servername DBServer'
as valid examples
However I want to not match on the string if its a certain server name or a certain string comes before Servername.
So I DON'T want to match on the following in an 'IF' condition
'Context Servername DBServer'
Or
'Servername Context'
Any help is very much appreciated.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: perl regexp question excluding strings
by GrandFather (Saint) on Nov 04, 2011 at 10:29 UTC | |
by bobg2011 (Novice) on Nov 05, 2011 at 02:01 UTC | |
|
Re: perl regexp question excluding strings
by choroba (Cardinal) on Nov 04, 2011 at 10:25 UTC | |
|
Re: perl regexp question excluding strings
by AnomalousMonk (Archbishop) on Nov 05, 2011 at 14:10 UTC |