From eb8199139f6e6bc75cdc6dac1ae1e09881a5ec8d Mon Sep 17 00:00:00 2001 From: Jonas Smedegaard Date: Tue, 25 Aug 2009 17:12:40 +0200 Subject: Improve keyword stripping: grab first set of word chars (instead of stripping all spaces) --- localmarkdown2sms | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'localmarkdown2sms') diff --git a/localmarkdown2sms b/localmarkdown2sms index d4d5720..06aa589 100755 --- a/localmarkdown2sms +++ b/localmarkdown2sms @@ -47,8 +47,8 @@ my ($path) = shift @ARGV; my ($phone) = shift @ARGV; my ($key) = lc (shift @ARGV); -# strip leading (and non-leading if ever possible?) spaces -$key =~ s/\s//g; +# strip non-word chars from keyword (and use only first chunk of word chars) +$key =~ s/.*?(\w+).*?/$1/; if ($debug) { Log::Log4perl->easy_init($DEBUG); -- cgit v1.2.3