From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id QBRFGwS51mN1mAAAbAwnHQ (envelope-from ) for ; Sun, 29 Jan 2023 19:20:52 +0100 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id eCJPGwS51mNeawEA9RJhRA (envelope-from ) for ; Sun, 29 Jan 2023 19:20:52 +0100 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 25D702EB18 for ; Sun, 29 Jan 2023 19:20:52 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pMCHp-0002mu-Eg; Sun, 29 Jan 2023 13:20:17 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pMCHm-0002mS-7b for emacs-orgmode@gnu.org; Sun, 29 Jan 2023 13:20:14 -0500 Received: from mout01.posteo.de ([185.67.36.65]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pMCHj-0005Dc-UR for emacs-orgmode@gnu.org; Sun, 29 Jan 2023 13:20:13 -0500 Received: from submission (posteo.de [185.67.36.169]) by mout01.posteo.de (Postfix) with ESMTPS id BDC3F240064 for ; Sun, 29 Jan 2023 19:20:05 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.jp; s=2017; t=1675016407; bh=Dj58vSVUup8p4QbkbEiZ+vYUbyTReXIAZiHgtpWoeHE=; h=Date:From:To:Subject:From; b=pwNHemd/WM4q/4klcYGnsoowbFkQZQHXkDvBbGwc5m8fAvUJPleX5lvIaUhoCZgYN MgDXip/qXJNI9IiAxbfoeR+h5RllXwLpnyDXOvvJpbhUvgSoddnrfbn4wU/cSjE7Q2 Z+uanZgYND/KyQNoOXPViOYVBux7nVfez8WRE/nTh3vmP6dR+EXw1AArDbu7j/u4xw G2fXEsi9W+6IWbOCrF3wIwtx0/LrYgcHsBSXnFLIHuwOrTCPf7EQuVhektDHaJaV8J XqN1O304R0viRN4UrqRgylbbQeIcDOvxA/1vBcg9B7EDeO0HUlsX/YLCsgmokVRx6b p0qJhyi7PwYSA== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4P4fjw4cVyz9rxF for ; Sun, 29 Jan 2023 19:20:04 +0100 (CET) Date: Sun, 29 Jan 2023 18:20:03 +0000 From: To: emacs-orgmode@gnu.org Subject: Re: Inline markup: How does org identify nested code/verbatim? In-Reply-To: <4P4fNv4F48z6tmQ@submission01.posteo.de> References: <4P4fNv4F48z6tmQ@submission01.posteo.de> Followup-To: emacs-orgmode@gnu.org MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Message-Id: <4P4fjw6Xy3z9rxN@submission02.posteo.de> Received-SPF: pass client-ip=185.67.36.65; envelope-from=c.buhtz@posteo.jp; helo=mout01.posteo.de X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: emacs-orgmode-bounces+larch=yhetil.org@gnu.org X-Migadu-Country: US X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1675016452; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post:dkim-signature; bh=Dj58vSVUup8p4QbkbEiZ+vYUbyTReXIAZiHgtpWoeHE=; b=s4pACLay0N4Mst2ih9DZI0gSTjxAgs1Gh0XaF3G4aoNKzhL/pE4vJn8a3rP+VUKdTpFlz0 yvstO8WEY12GBk59ZpFATMmAKhpF0tNAIpyfpsuxbQwKImQs1sApS6OHi1LFm2Dy4SlkJV UXxsHFo5jflk+0oH+4LCFgLUlNYczrCTnjVMx7KicuAV6BD+EdCmuNuWc2SLAaX8W6W5a1 u2VCkznHhFRWVtgeM1P4JbkIaDVE5L3XQQLVetCfZ3Ona5Gpv6svH91fLpwoJZKcJUwOsT TeLXZkqp5r53oKI9QCXFs0skZ5ppo19dfpoau6KbxTgOi+KdIG5ZdVEP/3WLZA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=posteo.jp header.s=2017 header.b="pwNHemd/"; dmarc=pass (policy=none) header.from=posteo.jp; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org" ARC-Seal: i=1; s=key1; d=yhetil.org; t=1675016452; a=rsa-sha256; cv=none; b=VGNFZgKHKxNBsVeqsYps/dPKky9zAmijkHsRl0dpaDvvNleS6hHiXqtgljhN2SfVq6S+r1 5KDrIlTl0SVTvI8C6rOYdTo40POz4Vf7BpxO5Dn9Q2/vZ9gFVh9YfwZxXMsfSQFzR17w/P oA0kaWDUaIu9erEkgwgnCEyg/zmlHwKraJIjJY3tH/hLBqav+4t5yxSMjSpXVLGlMzdB8/ WM2SuLjjPwlKDyVpMxcfIrTbmCLr77aZ90IIGVcl4vHdXXCkJ6i2X/L/6DBoQuo/5Iqp9e aijGQr+8vHJvHCHnAggA7CBSXmnCLSF0s5dYWqUWw+V02un8BARgQOzCCBv7nw== X-Spam-Score: -5.36 X-Migadu-Spam-Score: -5.36 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=posteo.jp header.s=2017 header.b="pwNHemd/"; dmarc=pass (policy=none) header.from=posteo.jp; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org" X-Migadu-Queue-Id: 25D702EB18 X-Migadu-Scanner: scn1.migadu.com X-TUID: nXmCpolooomI Please let me add the nested-regex-approach. I wouldn't call this a solution but just an approach. No one understand that regex it is nearly unmaintainable. I hope for a more elegant solution. This matches if we have code in verbatim ^|[ .,;:\-?!({\"']=.*?(?:^|[ .,;:\-?!({\"']~.*?~[.,;:\-?!)}\"']|$).*?=[ .,;:\-?!)}\"']|$ This matches if we have verbatim in code (?:^|[ .,;:\-?!({\"']~.*?(?:^|[ .,;:\-?!({\"']=.*?=[.,;:\-?!)}\"']|$).*?~[ .,;:\-?!)}\"']|$) If one of this matching I now which one of my "usual" regex pattern using catching groups to extract the content I should use first. Just for testing (maybe on regex101.com) here is the text I used. This =is ~code~ in verbatim= text. This =is usual verbatim= text. This ~is =verbatim= in code~ text. This ~is usual code~ text.