From: Thorsten Jolitz <tjolitz@gmail.com>
To: help-gnu-emacs@gnu.org
Subject: Regexp to match 't' in a nested list?
Date: Thu, 12 Sep 2013 19:03:36 +0200 [thread overview]
Message-ID: <87ioy60y6v.fsf@gmail.com> (raw)
Hi List,
for making Emacs Lisp talk to PicoLisp, I have to upcase t and nil (T
and NIL in PicoLisp) in nested lists that contain all kinds of strings
and keywords in possibly many languages. Using the more difficult 't'
case as example, so far I came up with this regexp that doesn't seem to
give false positives:
,------------------------------------------
| "\\( t \\|(t \\| t)\\|(t)\\|^t \\| t$\\)"
`------------------------------------------
(same thing for nil, just replace t with nil)
But the regexp misses at least one case: a string like
,----------------
| " t t nil nil "
`----------------
will be converted to
,----------------
| " T t NIL nil "
`----------------
I cannot find a solution for this case that does not immediately results
in false positives when applied to a string like
,------------------------------------------------
| " t t nil nil total albanil nilonga tat mitat "
`------------------------------------------------
Any tips/hints would be appreciated.
--
cheers,
Thorsten
next reply other threads:[~2013-09-12 17:03 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-09-12 17:03 Thorsten Jolitz [this message]
2013-09-12 17:16 ` Regexp to match 't' in a nested list? Jambunathan K
2013-09-12 17:41 ` Thorsten Jolitz
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87ioy60y6v.fsf@gmail.com \
--to=tjolitz@gmail.com \
--cc=help-gnu-emacs@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.