Your skill will accomplish what the force of many cannot |
|
PerlMonks |
Re^3: Extract IP from email dataset?by tweetiepooh (Hermit) |
on May 12, 2009 at 15:57 UTC ( [id://763518]=note: print w/replies, xml ) | Need Help?? |
If you have this "limited" set then you can simplify your regex to extract something that looks like an IP address though it won't validate it in any form.
Just think about what you are looking for and work from there. How do you as a human pick out IP addresses? Now how can you define that in a regex? Don't worry if it's a valid IP since you maybe able to assume that the source already has done some of that for you. If you do want to make sure you only get valid IP then as already suggested, check CPAN. (Or work it out for yourself as a nice exercise.)
In Section
Seekers of Perl Wisdom
|
|