after staring at this screen for about 20 minutes I finally gave up and have posted this here, i need a reg-ex that will pull the ip out of an ifconfig -a of the local machiene.

but i cannot figure out how to make it work on both types of OS's that we use here as Sun does it their way and Linux does it differently. so here are the two things that i need to match. i need the inet adder of eth0 and hme0,

thanks for helping with this simple question.
eth0 Link encap:Ethernet HWaddr 00:40:F4:48:1F:B1 inet addr:192.168.0.100 Bcast:192.168.0.255 Mask:255.255.2 +55.0 UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:163706 errors:0 dropped:0 overruns:0 frame:0 TX packets:140415 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:100 RX bytes:24892923 (23.7 Mb) TX bytes:35772845 (34.1 Mb) Interrupt:12 Base address:0x6000 lo Link encap:Local Loopback inet addr:127.0.0.1 Mask:255.0.0.0 UP LOOPBACK RUNNING MTU:16436 Metric:1 RX packets:1057866 errors:0 dropped:0 overruns:0 frame:0 TX packets:1057866 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:88084418 (84.0 Mb) TX bytes:88084418 (84.0 Mb) ........ lo0: flags=1000849<UP,LOOPBACK,RUNNING,MULTICAST,IPv4> mtu 8232 index +1 inet 127.0.0.1 netmask ff000000 hme0: flags=1000843<UP,BROADCAST,RUNNING,MULTICAST,IPv4> mtu 1500 inde +x 2 inet 192.168.132.10 netmask ffffff00 broadcast 192.168.132.255
thanks for the help

jcpunk

by the way thanks for all the help that was, is, and will be


In reply to pattern matching difficulties, in two cases by jcpunk

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.