"be consistent" | |
PerlMonks |
regular expression assistanceby notasaint (Initiate) |
on May 09, 2008 at 20:52 UTC ( [id://685770]=perlquestion: print w/replies, xml ) | Need Help?? |
notasaint has asked for the wisdom of the Perl Monks concerning the following question: I think I'm just down to the regular expression I need for finding the line in the hosts file 192.168.1.45 hostname.domain.com hostname so it can be replaced with the new values. Unfortunately, I am bound by the modules that already exist within the Perl build on the laptops and that does not include Regex so I can't use $RE{net}{IPv4}. In the following segment of the script I have the expression to verify that there are four octets and that they are in the correct potential ranges:
However, I'm having issues with formulating the regular expression in the foreach loop if anyone could provide me with some guidance.
TIA -nas
Back to
Seekers of Perl Wisdom
|
|