Help for this page

Select Code to Download


  1. or download this
    my $lookAhead = qr/ (?! (?: .*\.){2,}) /x;
    my $regex = qr/ ^ $lookAhead [+-]? [\d.]+ $/x;
    ...
        say "\$str => $str";
        if ($str =~ / [+-]?[\d.]+ /x) {  # Pattern fails without this step
    +; why???
            if ($& =~ $regex) {