We Recommend

Learning Perl Learning Perl
In this smooth, carefully paced course, a leading Perl trainer teaches you to program in the language that threatens to make C, sed, awk, and the Unix shell obsolete for many tasks. This book is the "official" guide for both formal (classroom) and informal learning. It is fully accessible to the novice programmer.


Posted By

0xced on 12/04/07


Tagged

regular perl Expression extract oneliner


Versions (?)


Who likes this?

1 person has marked this snippet as a favorite

darkphotn


One liner perl extract content with regular expression


Published in: Perl 


Don't use the -l switch if you don't want a new line.


  1. curl -s http://checkip.dyndns.org | perl -nle 'print "$1" if (/Current IP Address: ([\d.]*)/)'

Report this snippet 

You need to login to post a comment.