æ£è¦è¡¨ç¾ã®ç·´ç¿
30åããã°ã©ã ããã®739ãhttp://gauc.no-ip.org/awk-users-jp/blis.cgi/DoukakuAWK_265ã«ã¤ã³ã¹ãã¤ã¢ããã¾ããã
æ£è¦è¡¨ç¾ã«ãããããé¨åã«è²ãã¤ãã¦ãããã¹ã¯ãªããã§ãã
使ãæ¹
$ perl color_regexp.pl '(na)+' banana banana
ã½ã¼ã¹ã³ã¼ã
#! /usr/bin/perl # -*- mode:perl; coding:utf-8 -*- use strict; use warnings; use Data::Dumper; sub color_regexp($$){ my ($reg, $str) = @_; $str =~ s/$reg/\033[32m$&\033[0m/g; $str; } my ($reg, $str) = @ARGV; print color_regexp($reg, $str),"\n";