Loading ...
Sorry, an error occurred while loading the content.

Regular Expression Question

Expand Messages
  • Mike D
    Hello, I have a log file of HTML code and I need to find a string and set a PERL variable equal to the value that follows the string. So the HTML code looks
    Message 1 of 3 , Mar 1, 2001
    • 0 Attachment
      Hello,

      I have a log file of HTML code and I need to find a
      string and set a PERL variable equal to the value that
      follows the string. So the HTML code looks something
      like this:

      <TR>
      <TD>frequencyBand</TD>
      <TD>:</TD>
      <TD>ota1800</TD>
      </TR>

      So I need to grep for "frequencyBand" and get the
      value "ota1800" and set it equal to a PERL variable.

      I've tried a few things but nothing is working
      currently. Any help is greatly appreciated.

      Thanks,
      -MikeD

      __________________________________________________
      Do You Yahoo!?
      Get email at your own domain with Yahoo! Mail.
      http://personal.mail.yahoo.com/
    • libertyhosting
      Hi All, I need to to drop the B of the end of a string. What would be the best way to do this. For Ex. $itemcode = AW-304B I need it to be AW-309. Any help
      Message 2 of 3 , Mar 6, 2003
      • 0 Attachment
        Hi All,

        I need to to drop the "B" of the end of a string. What would be the
        best way to do this.

        For Ex.
        $itemcode = AW-304B

        I need it to be AW-309.

        Any help is greatly appreciated.

        Greg
      • prakash
        $itemcode =~ s/B$//;
        Message 3 of 3 , Mar 6, 2003
        • 0 Attachment
          $itemcode =~ s/B$//;



          > -----Original Message-----
          > From: libertyhosting [mailto:greg@...]
          > Sent: Thursday, March 06, 2003 2:21 PM
          > To: perl-beginner@yahoogroups.com
          > Subject: [PBML] Regular Expression Question
          >
          >
          > Hi All,
          >
          > I need to to drop the "B" of the end of a string. What would be the
          > best way to do this.
          >
          > For Ex.
          > $itemcode = AW-304B
          >
          > I need it to be AW-309.
          >
          > Any help is greatly appreciated.
          >
          > Greg
          >
          >
          >
          >
          > Unsubscribing info is here:
          > http://help.yahoo.com/help/us/groups/groups-32.html
          >
          > Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
          >
          >
          > ______________________________________________________
          > This email was pre-scanned by Spam Guardian
          > A Service Provided by www.foothill.net and FNFmail.com
          >
          >
        Your message has been successfully submitted and would be delivered to recipients shortly.