#! 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;
Perl Regex: extract words
最新推荐文章于 2024-07-09 07:41:55 发布