in reply to Re^3: Regular expression help
in thread Regular expression help
Well the problem is a bit more complicated. The solution McA has given certainly works.
Lets say in the loop, I first grep it for a particular user say, stephen by the following expression ,although the later part of this expression needs to be corrected for the server name and etc
if(/^\s+stephen(.*)/)
And , now for the subsequent iteration, I want to grep all the user names and servername,version name for other users who are not stephen. That is becoming a problem to uniquely identify the lines for which the user name is not known. So using split is a problem.
Can't I have a regular expression of the following pattern :
$line =~ /^\s+(any user but stephen) (machine name) (version)(server)(date time )/
Hope I could explain the problem.
Thanks.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^5: Regular expression help
by pvaldes (Chaplain) on Mar 12, 2013 at 09:53 UTC |