[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Regexp to match 't' in a nested list?

From: Thorsten Jolitz
Subject: Regexp to match 't' in a nested list?
Date: Thu, 12 Sep 2013 19:03:36 +0200
User-agent: Gnus/5.130002 (Ma Gnus v0.2) Emacs/24.3 (gnu/linux)

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.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]