in reply to Regular expression
hi,
If my guess is correct, then follow the below said code:
while (<DATA>) { print "$&\n" if ($_=~/^\/(.+)modem$/); } __DATA__ /1sbc/dasds/sdf/dsd/modem /2sbc/dasds/FSFsdf/dsd/modem1 /3sbc/dasdFDAs/sFDASFdf/dsd/modem /4sbc/dasFSDAds/sdf/dFDsd/modem3
output
/1sbc/dasds/sdf/dsd/modem
/3sbc/dasdFDAs/sFDASFdf/dsd/modem
regards
franklin
Don't put off till tomorrow, what you can do today.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Regular expression
by Mandrake (Chaplain) on Jun 22, 2006 at 05:54 UTC |