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

Re: [PBML] Need help with reg expression

Expand Messages
  • Bilashi Sahu
    Try with this, it works for me my $str1 = abcdefgh.txtt ; if ($str1 =~ /^ w{8} . w{3}$/) { print $str1 n ; } else { print not 8.3 string n ; } From:
    Message 1 of 4 , Oct 1, 2010
    • 0 Attachment
      Try with this, it works for me

      my $str1 = "abcdefgh.txtt";
      if ($str1 =~ /^\w{8}\.\w{3}$/)
      {
      print "$str1\n";
      }
      else
      {
      print "not 8.3 string\n";
      }





      From: perl-beginner@yahoogroups.com
      To: perl-beginner@yahoogroups.com
      Cc:
      Sent: Friday, October 1, 2010 12:05:54 PM
      Subject: [PBML] Need help with reg expression



      Hi all,

      I have a quick question. I am trying to make sure only 8.3 type string is matched but the below code prints 8.4 . Is there a way I could make sure it gets ignored or return false since its not matching 8.3

      $string = "abcdefgh.txtt" ;
      if($string =~ m/^\S{1,8}\.\S{0,3}/){print $string} ;

      any help appreciated,
      regards







      [Non-text portions of this message have been removed]
    • 秦斌
      try if($string =~ m/^ S{1,8} . S{0,3}$/){print $string} ; 2010/10/2 asp66 ... [Non-text portions of this message have been removed]
      Message 2 of 4 , Oct 4, 2010
      • 0 Attachment
        try
        if($string =~ m/^\S{1,8}\.\S{0,3}$/){print $string} ;


        2010/10/2 asp66 <asp66@...>

        >
        >
        > Hi all,
        >
        > I have a quick question. I am trying to make sure only 8.3 type string is
        > matched but the below code prints 8.4 . Is there a way I could make sure it
        > gets ignored or return false since its not matching 8.3
        >
        > $string = "abcdefgh.txtt" ;
        > if($string =~ m/^\S{1,8}\.\S{0,3}/){print $string} ;
        >
        > any help appreciated,
        > regards
        >
        >
        >


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