X-Git-Url: https://git.decadent.org.uk/gitweb/?a=blobdiff_plain;f=Tagtools.pm;h=292e6e517a33c821e5f53bffd6efa2e3faea6a71;hb=f2b33d6a43cde2f4e9c1170f3ae15a5cfb62d09e;hp=0fc2529b370505206b4bc99f3aed29aae1c49b09;hpb=0462f25b10e5adb4eacc0e11f4ced5165784f38f;p=memories.git diff --git a/Tagtools.pm b/Tagtools.pm index 0fc2529..292e6e5 100644 --- a/Tagtools.pm +++ b/Tagtools.pm @@ -4,6 +4,7 @@ use Carp; use Cache::FileCache; use Storable qw(freeze); use MIME::Base64; use Calendar::Simple; +use Text::Balanced qw(extract_multiple extract_quotelike); sub import { my $whence = caller; my ($class) = @_; @@ -57,6 +58,14 @@ sub import { } +sub separate_tags { + map { s/^"|"$//g; $_} + extract_multiple( + lc $_[1], [ + \&extract_quotelike, + qr/([^\s,]+)/ + ], undef,1) +} # THIS IS A HACK