From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Thorsten Jolitz Newsgroups: gmane.emacs.help Subject: Regexp to match 't' in a nested list? Date: Thu, 12 Sep 2013 19:03:36 +0200 Message-ID: <87ioy60y6v.fsf@gmail.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1379005557 26407 80.91.229.3 (12 Sep 2013 17:05:57 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 12 Sep 2013 17:05:57 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu Sep 12 19:06:00 2013 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1VKAKa-0004ni-PW for geh-help-gnu-emacs@m.gmane.org; Thu, 12 Sep 2013 19:05:24 +0200 Original-Received: from localhost ([::1]:42927 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VKAKa-0003mf-Bc for geh-help-gnu-emacs@m.gmane.org; Thu, 12 Sep 2013 13:05:24 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:36576) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VKAKI-0003jW-N9 for help-gnu-emacs@gnu.org; Thu, 12 Sep 2013 13:05:13 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VKAKB-0007g6-Eg for help-gnu-emacs@gnu.org; Thu, 12 Sep 2013 13:05:06 -0400 Original-Received: from plane.gmane.org ([80.91.229.3]:49765) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VKAKB-0007g2-7y for help-gnu-emacs@gnu.org; Thu, 12 Sep 2013 13:04:59 -0400 Original-Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1VKAJE-000339-O1 for help-gnu-emacs@gnu.org; Thu, 12 Sep 2013 19:04:00 +0200 Original-Received: from e178062143.adsl.alicedsl.de ([85.178.62.143]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 12 Sep 2013 19:04:00 +0200 Original-Received: from tjolitz by e178062143.adsl.alicedsl.de with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 12 Sep 2013 19:04:00 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 40 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: e178062143.adsl.alicedsl.de User-Agent: Gnus/5.130002 (Ma Gnus v0.2) Emacs/24.3 (gnu/linux) Cancel-Lock: sha1:l8Xzo6alhvlhM6/F2JKTNxRWigw= X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 80.91.229.3 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:93354 Archived-At: 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