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

Re: [PBML] Split between letters and numbers

Expand Messages
  • Jeff Pinyan
    ... You re not using it correctly; don t print $1 or $2 afterwards, print $port. The code I gave changes $port for you. -- [Mary said,] Do whatever he tells
    Message 1 of 6 , Oct 8, 2007
    • 0 Attachment
      On 10/8/07, Dukelow, Don <dukelow@...> wrote:
      > Gret idea but not quite1 Using the following code.
      >
      > print "$port\n";
      >
      > $port =~ s/([a-z])(\d)/$1 $2/;
      >
      > print "$1 == $2\n";
      >
      > I get the results, It drops the first letter. I don't understand
      > either.
      >
      > ge0
      > e == 0

      You're not using it correctly; don't print $1 or $2 afterwards, print
      $port. The code I gave changes $port for you.

      --
      [Mary said,] "Do whatever he tells you." ~ John 2:5
    • Dukelow, Don
      Thank you that worked regular expressions isn t my strong point, but I m wotking on it. ... Don Dukelow HP UNIX OVO Enrollment Hewlett-Packard (Canada) Co.
      Message 2 of 6 , Oct 8, 2007
      • 0 Attachment
        Thank you that worked regular expressions isn't my strong point, but I'm
        wotking on it.


        -----
        Don Dukelow
        HP UNIX OVO Enrollment
        Hewlett-Packard (Canada) Co.
        e-mail: dukelow@...
        URL: http://www.hp.ca <http://www.hp.ca/>




        ________________________________

        From: perl-beginner@yahoogroups.com
        [mailto:perl-beginner@yahoogroups.com] On Behalf Of Jeff Pinyan
        Sent: Monday, October 08, 2007 4:25 PM
        To: perl-beginner@yahoogroups.com
        Subject: Re: [PBML] Split between letters and numbers



        On 10/8/07, Dukelow, Don <dukelow@... <mailto:dukelow%40hp.com> >
        wrote:
        > Gret idea but not quite1 Using the following code.
        >
        > print "$port\n";
        >
        > $port =~ s/([a-z])(\d)/$1 $2/;
        >
        > print "$1 == $2\n";
        >
        > I get the results, It drops the first letter. I don't understand
        > either.
        >
        > ge0
        > e == 0

        You're not using it correctly; don't print $1 or $2 afterwards, print
        $port. The code I gave changes $port for you.

        --
        [Mary said,] "Do whatever he tells you." ~ John 2:5





        [Non-text portions of this message have been removed]
      • Dukelow, Don
        This also works! $port =~ s/( D)( d)/$1 $2/; ... Don Dukelow HP UNIX OVO Enrollment Hewlett-Packard (Canada) Co. e-mail: dukelow@hp.com URL: http://www.hp.ca
        Message 3 of 6 , Oct 8, 2007
        • 0 Attachment
          This also works!
          $port =~ s/(\D)(\d)/$1 $2/;


          -----
          Don Dukelow
          HP UNIX OVO Enrollment
          Hewlett-Packard (Canada) Co.
          e-mail: dukelow@...
          URL: http://www.hp.ca <http://www.hp.ca/>




          ________________________________

          From: perl-beginner@yahoogroups.com
          [mailto:perl-beginner@yahoogroups.com] On Behalf Of Jeff Pinyan
          Sent: Monday, October 08, 2007 4:25 PM
          To: perl-beginner@yahoogroups.com
          Subject: Re: [PBML] Split between letters and numbers



          On 10/8/07, Dukelow, Don <dukelow@... <mailto:dukelow%40hp.com> >
          wrote:
          > Gret idea but not quite1 Using the following code.
          >
          > print "$port\n";
          >
          > $port =~ s/([a-z])(\d)/$1 $2/;
          >
          > print "$1 == $2\n";
          >
          > I get the results, It drops the first letter. I don't understand
          > either.
          >
          > ge0
          > e == 0

          You're not using it correctly; don't print $1 or $2 afterwards, print
          $port. The code I gave changes $port for you.

          --
          [Mary said,] "Do whatever he tells you." ~ John 2:5





          [Non-text portions of this message have been removed]
        Your message has been successfully submitted and would be delivered to recipients shortly.