Help for this page

Select Code to Download


  1. or download this
    my $string = qq{var1='1' var2="2" var3="3"};
    
    while ( $string =~ /(\w+)=(['"])(.*?)\2/g) {
        print "$1 = $3\n";
    }
    
  2. or download this
    use 5.010_000;
    
    while ( $string =~ /(?<variable>\w+)=(?<delim>['"])(?<value>.*?)\k<del
    +im>/g) {
        say "$+{variable} = $+{value}";
    }