Perl Regex: extract words

    技术2022-05-11  111

    #! perl -w $/ = "/n"; #print ($0 =~ /([^]*?)$/ ); this is a comment $foo = "word1 is2 the remain ..."; ($f1, $f2, $etc) = split(' ', $foo, 3); print $f1; print $f2; print $etc; #do the same operation ($a1, $a2, $a3) = ($foo =~ /^/s*(/S+)/s+(/S+)/s*(.*)/); print $a1; print $a2; print $a3;

    最新回复(0)