because i don't have enough hours in my day or enough capacity in my brain I have decided to learn perl is just not going to happen.

I am a c++ programmer and seem to be able to work my way round scripts of most kinds.

Anyway I have been doing to mrtg logging and I have a couple of scripts which need to pull an uptime from my modem using snmp.

I have the script to do it BUT I need a tiny bit of help with the pattern matching so I can pull the string out of the returned string from the snmpget command.

ok, there are TWO formats I could get back

system.sysUpTime.0 = Timeticks: (28926461) 3 days, 8:21:04.61.

OR

system.sysUpTime.0 = Timeticks: (28926461) 8:21:04.61.

I have a script but I need the pattern matching string to accept this line and pull out EVERYTHING after the ')'

i.e.

3 days, 8:21:04.61.
or
8:21:04.61.

Please help, I managed some basic pattern matching but the fact that it uses a ')' and then I need everything after it, seems to have me stumped.

Thanks guys

In reply to snmpget regex by hysteriaweb

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.