[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[O] Re: [Orgmode] [HOW] no way to escape vertical bar (pipe char) in tab
From: |
Eric Schulte |
Subject: |
[O] Re: [Orgmode] [HOW] no way to escape vertical bar (pipe char) in tables? |
Date: |
Mon, 07 Mar 2011 08:47:36 -0700 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux) |
Vladimir Alexiev <address@hidden> writes:
> I want to manage some perl regexps in a table
> then feed them to a code block (literate programming).
> Unfortunately they include alternatives (|)
> and the table editor thinks this is a column break.
>
> There's no way to escape this?
>
Using a different character (namely ¦) the following should work
#+source: clean
#+begin_src emacs-lisp :var in=""
(flet ((clean (in)
(if (listp in)
(mapcar #'clean in)
(if (stringp in)
(replace-regexp-in-string "¦" "|" in)
in))))
(clean in))
#+end_src
#+results: regexps
| first | (a¦b) |
| second | (1¦2) |
#+begin_src perl :var a=clean(in=regexps)[0,1] :var b=clean(in=regexps)[1,1]
$a; $b;
#+end_src
#+results:
: (1|2)
Best -- Eric