getting error in regular expression

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • lakshmikant
    New Member
    • Jun 2012
    • 3

    getting error in regular expression

    Code:
    $digits = "123456789";
    @nonlap	= $digits =~ /(\d\d\d)/g;
    @yeslap = $digits =~ /(?=\d\d\d\)/g;
    print "non-overlapping: @nonlap\n";
    print "overlapping: @yeslap\n";
    can anyone tell me whats wrong with it, I am not able to get the answer.
    code is in perl
    Last edited by numberwhun; Aug 6 '12, 06:04 AM. Reason: Please use CODE tags!
  • numberwhun
    Recognized Expert Moderator Specialist
    • May 2007
    • 3467

    #2
    First, please use CODE tags!

    Second, your topic is "Error in Regular Expression", yet you don't provide any error from the script execution. You need to please provide more information about what is happening before we can help you. Also, what are you expecting to see?

    Regards,

    Jeff

    Comment

    • sabari
      New Member
      • Dec 2012
      • 2

      #3
      TRY THIS....

      $digits = "123456789" ;
      (@nonlap) = $digits =~ /(\d\d\d)/g;
      (@yeslap) = $digits =~ /(?=\d\d\d)/g;
      print "non-overlapping: @nonlap\n";
      print "overlappin g: @yeslap\n";

      Comment

      Working...