[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [O] phone links...
From: |
Michael Strey |
Subject: |
Re: [O] phone links... |
Date: |
Thu, 4 Apr 2013 15:55:46 +0200 |
User-agent: |
Mutt/1.5.21 (2010-09-15) |
On Thu, Apr 04, 2013 at 10:26:53AM +0200, Michael Strey wrote:
[...]
> Usually my phone links look like [[tel:+49 351 4129535]]; but since I
> imported data sets from a larger contact data base that had evolved over
> time, I ended up with stuff like this in my data base:
> 1. [[tel:0033 (0) 4568-33]]
> 2. [[tel:+49 (0)3 8899 66]]
> 3. [[tel:0351 41295-35]]
> 4. [[tel:0351/4129535]]
> 5. [[tel:(0351) 412 95-35]]
>
> My filter function currently handles the cases 1. to 4. but (for no
> other reason than carelessness) not 5.
[...]
Here is a re-work of the filter function that handles all off the above
cases correctly.
#+BEGIN_SRC emacs-lisp
(defun trim-phone-number (phonenumber)
"Remove whitespaces from a telephone number"
(setq trimmed_phonenumber
(mapconcat 'identity
(split-string
(mapconcat 'identity
(split-string phonenumber "(0)") "") "[()/ -]") "")))
#+END_SRC
I'm a Elisp newbie. I'm sure that there are smarter solutions to solve this
problem.
Regards
--
Michael Strey
www.strey.biz
- Re: [O] phone links..., Robert Goldman, 2013/04/01
- Re: [O] phone links..., Bastien, 2013/04/04
- Re: [O] phone links..., Simon Thum, 2013/04/04
- Re: [O] phone links..., Robert P. Goldman, 2013/04/04
- Re: [O] phone links..., Bastien, 2013/04/05
- Re: [O] phone links..., Simon Thum, 2013/04/06
- Re: [O] phone links..., Simon Thum, 2013/04/06
- Re: [O] phone links..., Bastien, 2013/04/06
Re: [O] phone links..., Robert P. Goldman, 2013/04/04