Perl Regex: extract words

来源:互联网 发布:msn软件下载 编辑:程序博客网 时间:2024/05/29 23:46
#! 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;
原创粉丝点击