From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id MLBWMpLa12NMyQAAbAwnHQ (envelope-from ) for ; Mon, 30 Jan 2023 15:56:18 +0100 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id 6HwiMpLa12M7JwAAauVa8A (envelope-from ) for ; Mon, 30 Jan 2023 15:56:18 +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 48BB03C4D3 for ; Mon, 30 Jan 2023 15:56:18 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pMVZX-0000XF-7Y; Mon, 30 Jan 2023 09:55:51 -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 1pMVZQ-0000WS-Eg for emacs-orgmode@gnu.org; Mon, 30 Jan 2023 09:55:45 -0500 Received: from mout02.posteo.de ([185.67.36.66]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pMVZO-0000zc-Mf for emacs-orgmode@gnu.org; Mon, 30 Jan 2023 09:55:44 -0500 Received: from submission (posteo.de [185.67.36.169]) by mout02.posteo.de (Postfix) with ESMTPS id 43876240252 for ; Mon, 30 Jan 2023 15:55:40 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1675090540; bh=5aTXG9EkxZc+1iuZvb4bdsdvI6WhVlZ8jiIo6iKDMVA=; h=From:To:Cc:Subject:Date:From; b=l3bvk6ubRKoyZXmXnjpqM37868eQmhPLyGyLlrB5q1NV3MjHJcIo53B+3jmr0lo+f FBYXoYoH16vBn6ZD2CR+tArhzSSqYyZyoXYaFy6bNwpFuu8CwD33QVzcIagw5/84SA Xwc28vvEn8advSHcFyobBzrpBZRp0EpbJHOmT2m0/K705PdlewU/oU3HHiCpeNMoxq YGUzz9NALOx3Pnqo5BaGdkJ6C4ae/8FsPeahLOfMQ1XwvBOaLAF6j2S/9oefsU5b4e iwJnyGcixVVjNXhHRE9mJYrflgchnfqvNtVwkDaAdXcZXr4wHh+hfqbA9sxxUqK3rl aQJS/7Q6tlB5A== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4P5B7Z32Hpz6tml; Mon, 30 Jan 2023 15:55:38 +0100 (CET) From: Ihor Radchenko To: c.buhtz@posteo.jp Cc: 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> Date: Mon, 30 Jan 2023 14:56:14 +0000 Message-ID: <87h6w83wc1.fsf@localhost> MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=185.67.36.66; envelope-from=yantar92@posteo.net; helo=mout02.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, RCVD_IN_MSPIKE_H2=-0.001, 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-Seal: i=1; s=key1; d=yhetil.org; t=1675090578; a=rsa-sha256; cv=none; b=kK4x9wSyZqJGbcWI7ZLq+CX+OMsn1H9j2LN9ZfvNE45u6LxwQXRCSq6oIg2JO2RCfkPn4Z y1vWA7LMwuUYsScsOpKH8ezJzFb0zFtBF4H6opLM60vzdU4AeJTeNMUezXNTV+oatGTSQi /Aujx1HOVfg3iZkbif14VX6A+evUPz9tHOip2+Ii8fShN8RWIwp51LwscZsh8XubYv6U3h wUmyBQU3tehxGSROBn8WGzRCax87WfQmX1y51eGrX7GIJd9GaPyvFEKfdwAmc011FkQ8Y5 c6T9ez61vt3o+L8j8qq+k2wfMFmS9673uenJ1OetXjt3HBPzen4eksKY/rN2SA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=l3bvk6ub; 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"; dmarc=pass (policy=none) header.from=posteo.net ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1675090578; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=JKX6pHiIPxX3Bhf2sWOQJDztiJvGhKeezCB08Wci674=; b=jSZ2oodlApdAZzyZaVMffUl7c4WJX+RYM7ZDNbZiUm/vNctxqdT8C+AwyJVMg5El5RC0MT VMzJNaSqLETXI1OujfRelO0c884LX0/m6GflAwqedZzvhUsw9TBXn8ZgM7Uok527fOp7uN /fEg55TWEPtnc5WzV9oJd149oOvcD/8cGWZGm5CCfhwt27L2IVZI4OzZSe0WrwrexxClIH mqi8RHa6f4pvMESPFRoK2Mf+JPRKHxl7SXvQtt03bz2o8qHi+6FH7DV9aD4SkxGvruk4Rh V7Qmz+UjKrbiyv8S87+bF8BlyzkqW8HFwM5iHx2tNj0ICyrkCPU/vfoGJ+4s3w== Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=l3bvk6ub; 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"; dmarc=pass (policy=none) header.from=posteo.net X-Migadu-Scanner: scn1.migadu.com X-Migadu-Spam-Score: -3.54 X-Spam-Score: -3.54 X-Migadu-Queue-Id: 48BB03C4D3 X-TUID: a6QSDXbi65uH writes: > The point is myself I'm able to identify code or verbatim with regex > including three catch groups for the content before, between and > after the inline markers. > > for verbatim: "(^|[ .,;:\-?!({\"'])=(.*?)=([ .,;:\-?!)}\"']|$)" > for code: "(^|[ .,;:\-?!({\"'])~(.*?)~([ .,;:\-?!)}\"']|$)" > > But they don't work together. In the example above I need to use the > verbatim regex first to make it right. See https://orgmode.org/worg/org-syntax.html#Emphasis_Markers Note that Org is not context-free. Within Org AST elements that can contain objects, the first match "wins": 1. Org looks at a text and searches the first matching object regexp 2. Everything before the match is considered plain-text 3. Everything inside the match is considered the matched object and then parsed recursively 4. go to (1) -- Ihor Radchenko // yantar92, Org mode contributor, Learn more about Org mode at . Support Org development at , or support my work at