From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1 ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id mMkUEUbQ72ALYAAAgWs5BA (envelope-from ) for ; Thu, 15 Jul 2021 08:05:58 +0200 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1 with LMTPS id 0P79CkbQ72DmMgAAbx9fmQ (envelope-from ) for ; Thu, 15 Jul 2021 06:05:58 +0000 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 9F4F32AE25 for ; Thu, 15 Jul 2021 08:05:57 +0200 (CEST) Received: from localhost ([::1]:44460 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m3uVQ-00043M-Kr for larch@yhetil.org; Thu, 15 Jul 2021 02:05:56 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:52554) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m3uUf-00043B-Ag for emacs-orgmode@gnu.org; Thu, 15 Jul 2021 02:05:09 -0400 Received: from relay1-d.mail.gandi.net ([217.70.183.193]:5181) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m3uUc-0001LT-FN for emacs-orgmode@gnu.org; Thu, 15 Jul 2021 02:05:08 -0400 Received: (Authenticated sender: lists@traduction-libre.org) by relay1-d.mail.gandi.net (Postfix) with ESMTPSA id B92E424000A for ; Thu, 15 Jul 2021 06:05:00 +0000 (UTC) From: Jean-Christophe Helary Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Mime-Version: 1.0 (Mac OS X Mail 14.0 \(3654.100.0.2.22\)) Subject: Re: help with a regexp Date: Thu, 15 Jul 2021 15:04:54 +0900 References: <87lf685gto.fsf@gmail.com> To: orgmode In-Reply-To: <87lf685gto.fsf@gmail.com> Message-Id: X-Mailer: Apple Mail (2.3654.100.0.2.22) Received-SPF: pass client-ip=217.70.183.193; envelope-from=lists@traduction-libre.org; helo=relay1-d.mail.gandi.net X-Spam_score_int: -25 X-Spam_score: -2.6 X-Spam_bar: -- X-Spam_report: (-2.6 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=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.23 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" X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1626329157; 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; bh=629osFJV8EvBuBSSBRp1evY7Mq049uAdXO/gl+M3CpQ=; b=JgJd/49ZU3fx/qeJ86ixH4UIAuINTB3qqyVoCzgO2GHjRCykIlYtePpjnc+Cj1Rap9NfUH 6aiGjY8YkJHabI0VOduowUPvI3YXkZuMktbCXDL0App779LneqtPbDFEYdGU34JvAW7bo3 asUZufNGUjDHr3b7ajcA4PeCSEp4criJeuQQvV5C1Cf0brMlcriznCiIEaiEgKPIRDE8T4 u3zsKjJhhlaT+i/0A1CI65bBY5bDjNsWC9h0GJ5WQUiXCHYJzEO4/C5a5lFTcu3yJbXyV0 sh8kXj42xGaAdjAoC11LCnROFvsd17pc9JVGqO5HNnZ51F3Z2lLAb/BLzrbawQ== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1626329157; a=rsa-sha256; cv=none; b=sGGdV82MKQUX9P75klPJn6kX3AJM9cLUjNcpc67imZRn+Xu3GUDy2IRTU4VcICl6hMXu1n JU4EMg9WUXpOIKj6n+kSk6n2tQYOjPUkF/Nsu3t8lFU3eYRORD/SpS+1VslQgviBc7NS6K llykqWJFutDAumK5sFjesBm2TLdM9Tx599EhNqLs2z8yxOfCAvDSJTYakAPKnrdRLUnmy+ vSL6Hjt/2vR9jJ0vDE8gTMYslRwL+EtkNv6h3SUAjadL8BH4JqCn/z8+xemVsObdoqS1cG cc8t6VYbn1bM4uWjSXIVTgM7ZmWwe0aQJ3v26VIRdGAYoA0BKegxzisBB88deg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none; spf=pass (aspmx1.migadu.com: domain of emacs-orgmode-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=emacs-orgmode-bounces@gnu.org X-Migadu-Spam-Score: -1.90 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of emacs-orgmode-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=emacs-orgmode-bounces@gnu.org X-Migadu-Queue-Id: 9F4F32AE25 X-Spam-Score: -1.90 X-Migadu-Scanner: scn0.migadu.com X-TUID: Sg2cvmK8Msyg > On Jul 15, 2021, at 13:41, Timothy wrote: >=20 >=20 > Hi John, >=20 > John Kitchin writes: >=20 >> Hi all, I could use a bit of help with a regexp. I am trying to fine = tune >> the org-ref citation regexp to make it orthogonal to org-cite. >>=20 >> I want to recognize these as org-ref links >>=20 >> [[cite:schuett-2018-schnet]] >> cite:schuett-2018-schnet >>=20 >> but not >>=20 >> [cite:@schuett-2018-schnet] >>=20 >> so either 0 or 2 [[ can prefix it to be a cite link in org-ref, but = not 1 [. >>=20 >> right now the cite: in the org-cite syntax is getting flagged as bad = cite >> link which I want to avoid. >>=20 >> is this doable? >=20 > I'd think so. Let me know if https://regex101.com/r/Ud6HVY/1 helps :) cite:[^@][A-Za-z0-9_-]+|\[\[cite:[^@][A-Za-z0-9_-]+\]\] There are no reasons to limit the string after : to ascii. in isearch I tried: \[\{2\}cite.*\]\{2\}\|[^\[]cite:[^ \ ]* And it seems to do the job. --=20 Jean-Christophe Helary @brandelune https://mac4translators.blogspot.com https://sr.ht/~brandelune/omegat-as-a-book/