From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id QMG7BhEx8GA0FwEAgWs5BA (envelope-from ) for ; Thu, 15 Jul 2021 14:58:57 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1 with LMTPS id yHmGABEx8GB6WQAAbx9fmQ (envelope-from ) for ; Thu, 15 Jul 2021 12:58:57 +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 0E451DAF6 for ; Thu, 15 Jul 2021 14:58:56 +0200 (CEST) Received: from localhost ([::1]:48026 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m40x4-0000nu-Tb for larch@yhetil.org; Thu, 15 Jul 2021 08:58:54 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:36238) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m40wY-0000l7-QA for emacs-orgmode@gnu.org; Thu, 15 Jul 2021 08:58:22 -0400 Received: from mail-qt1-x82e.google.com ([2607:f8b0:4864:20::82e]:34552) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1m40wW-0007cB-Hr for emacs-orgmode@gnu.org; Thu, 15 Jul 2021 08:58:22 -0400 Received: by mail-qt1-x82e.google.com with SMTP id g8so4457914qtj.1 for ; Thu, 15 Jul 2021 05:58:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:references:user-agent:from:to:cc:subject:in-reply-to :message-id:date:mime-version; bh=gxn5bGyeXCmAqlugIIyni66mexsyWften0/aT4f6kSI=; b=E2O+dRaMJ4Yem4NkYGR/T2noyb9qpYK5lWXbkLpUAG6yySWNI8Q0jDh2Knsubg7Csl GZkMGKR7BL8zgRe//Uc91Fg7i3pXkaqlQr2gSRpztcOGFMWmBab3Seh/OEJAlZtABLdI JZLZc/kaUAsJOzpHWfeN/2dPv/xL5uORQUWef3/DOrhT7JRuNS/Dsc9wo6gcuMBGIL4p tlz37ZTo6kJgQO0uHUQjSpx3gy9wE5bvAg9NhGgGcc58CetX8sEfPc3qWCSEuHhLJ59a 2x07miXE93lQ28yzzh6ZH9ed8/j0Twg9XAjgCZQTZf+aPNHsDMUsnVd2AuLSJGIZ992d imbQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:references:user-agent:from:to:cc:subject :in-reply-to:message-id:date:mime-version; bh=gxn5bGyeXCmAqlugIIyni66mexsyWften0/aT4f6kSI=; b=FdEqJ/rGXl3mGbACdIRpc4/ZAZFT5zw7w/K4NQkyTstfxrD/fZIrVSAwHWJgyJTt/c eP9s4U/Y5vWW5VpVq1sMqO2TJU1Oq5oaK32ygbGUZQ9tx/bVp0eWBZX1ps5wzsmlQsiV /rjPgRlYPZMc5qCuk/hhXcABQpzSVyUbSSB1yNSCgspCBwSAj69dOkLRfi28zwKANMeH yr8I7KvtEpRWLfyCu73u0pf8Hy61AP1iyXyscokf1mPrQLY+kaSSNWGuxfa7KVfl5YIi WUBw7ua4UxBWHakMDleD9iHytg+YvWqDWOBsUuPF2rMEm3A3AB+pQ1LQVdkv3BhDF1w4 rIUg== X-Gm-Message-State: AOAM5324albrgD8BuZ2XUa15vvEQ5x2mvqlQigeUdUKAjmRDFhESYzUm SZGU7ZqPrxxZQwdJ8jNo/3XgWfyJceLXdQ== X-Google-Smtp-Source: ABdhPJz1gom/uUR3Dw2yRfwJS84UzrOXsfEkt/yddWNFlAgkuOOp1HYl8h3z8zm3mUw996ZsKlk8yA== X-Received: by 2002:ac8:5910:: with SMTP id 16mr3919778qty.338.1626353898123; Thu, 15 Jul 2021 05:58:18 -0700 (PDT) Received: from Johns-iMac.local ([2601:547:901:82e0:b58a:19ef:fa8a:c221]) by smtp.gmail.com with ESMTPSA id h10sm2027407qta.74.2021.07.15.05.58.16 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 15 Jul 2021 05:58:17 -0700 (PDT) References: <87r1g0hsvr.fsf@gmx.net> User-agent: mu4e 1.4.15; emacs 27.2 From: John Kitchin To: Stephen Berman Subject: Re: help with a regexp In-reply-to: <87r1g0hsvr.fsf@gmx.net> Message-ID: Date: Thu, 15 Jul 2021 08:58:15 -0400 MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=2607:f8b0:4864:20::82e; envelope-from=johnrkitchin@gmail.com; helo=mail-qt1-x82e.google.com X-Spam_score_int: -14 X-Spam_score: -1.5 X-Spam_bar: - X-Spam_report: (-1.5 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.249, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.248, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no 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: , Cc: org-mode-email 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=1626353936; 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=gxn5bGyeXCmAqlugIIyni66mexsyWften0/aT4f6kSI=; b=hKt8YVLDtLbL+U2V7L9QTtwRsbNiE0GnAgdsgUUEJlpH5P7IRaTO+ClhvQTlMfxRQ/hmtN GiZ1p1Rl8l4Xeoji7kIRfNbOgMNW7e7fXwC5UQlVS830732uRM0oPtBPcaEGLLWTwcFkhE D14M2TpwQqgrLaag4pd+doTZ+L7SUZrbcqJkaZ8rlKWXq+mvz5z1HfptyKeT47mhGN9bsx tK7oh2Z4e2UTN7gnohM9iM1K8bH43Cti0eHpQi3f0RR5nS8BBjUuTf08e5pbFNBM4p/Z+j oEshx7lWGprujYlrzHERYGR2q/8FoIEGYq90pK4mU/VVcCjEEPQAcM3QHkY3+A== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1626353936; a=rsa-sha256; cv=none; b=XCa2KciSoWoGg0xaTP6O1jrbABkCNJHRTjM/9GU0nY8V0HJXOuUaKS8M4jEpcC/g41Rkp0 dMGNGmS57pDri7FLJXMR26nqddSXQdivZNMeoFwx5f5lOZZddqhv/oAuRHYxDOZNd0B5fV 8anMTkfjyUB+rLMh1+xK0omSzxiMimy4RygmebDI+CC8WpxQDTAJ62mIoDDtK8uf4hK0cE EDdZRz+tkyPrKmE9LfEB701kfaQq6CeMDL1/PzCPZTIv1TPT1hwH9NIfsPeSH6AHgzU7OM tBzrO7q632srUHMupXwgwHsyu6Z+j3H+BZzWv893AYVaRbzXDpsFIiwGjOJHHA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20161025 header.b=E2O+dRaM; 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.30 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20161025 header.b=E2O+dRaM; dmarc=fail reason="SPF not aligned (relaxed)" header.from=andrew.cmu.edu (policy=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: 0E451DAF6 X-Spam-Score: -1.30 X-Migadu-Scanner: scn0.migadu.com X-TUID: ZLf1tMQdKHnu Thanks everyone, these are all good suggestions. I realized though the problem is that org-mode is recognizing something like [cite:@darby-2018-lonel-atoms] as a cite link because of the cite: part of it. In fact org-mode seems to recognize all [link:path] as an org link. In general that seems ok, but it leads to overlapping syntax with org-cite and the one org-ref link. It seems to be a partial solution to remove the cite link from org-link-parameters, but that isn't ideal to me because older documents won't work with org-ref that way (most of mine use cite: very extensively). The best solution in my opinion would be for org-mode to not recognize [cite:...] as a link. Other ideas? Thanks, Stephen Berman writes: > On Wed, 14 Jul 2021 20:43:24 -0400 John Kitchin wrote: > >> 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. >> >> I want to recognize these as org-ref links >> >> [[cite:schuett-2018-schnet]] >> cite:schuett-2018-schnet >> >> but not >> >> [cite:@schuett-2018-schnet] >> >> so either 0 or 2 [[ can prefix it to be a cite link in org-ref, but not 1 [. >> >> right now the cite: in the org-cite syntax is getting flagged as bad cite link which I want to avoid. >> >> is this doable? > > For your example this is sufficient (for real usage you probably want to > add more context to the right of 'cite'): > > (re-search-forward "\\[\\[cite:\\|[^[]cite:") > > Steve Berman -- Professor John Kitchin Doherty Hall A207F Department of Chemical Engineering Carnegie Mellon University Pittsburgh, PA 15213 412-268-7803 @johnkitchin http://kitchingroup.cheme.cmu.edu Pronouns: he/him/his