NAME String::Filter - a regexp-based string filter SYNOPSIS # define the rules that convert tweets to HTML # (handles url, @user, #hash) my $sf = String::Filter->new( rules => [ 'http://[A-Za-z0-9_\-\~\.\%\?\#\@/]+' => sub { my $url = shift; sprintf( '<a href="%s">%s</a>', encode_entities($url), encode_entities($url), ); }, '(?:^|\s)\@[A-Za-z0-9_]+' => sub { $_[0] =~ /^(.*?\@)(.*)$/; my ($prefix,