From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Yuri Khan Newsgroups: gmane.emacs.help Subject: Re: Regexp with comment character of buffer Date: Mon, 12 Aug 2024 18:03:22 +0700 Message-ID: References: <5my4_hPxAvHxrSRXBqG0sOdSxA9OXe9rRX9fl7efeXWgi5h6EAw4Oh3a7VllRQNz6URMUcjIPkRcOGMn6RCYxbF0Au7lTb2BCkm4ffPuv3A=@protonmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="11719"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Heime via Users list for the GNU Emacs text editor To: Heime Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Mon Aug 12 13:04:10 2024 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1sdSqQ-0002qb-2k for geh-help-gnu-emacs@m.gmane-mx.org; Mon, 12 Aug 2024 13:04:10 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sdSq0-0000bG-KZ; Mon, 12 Aug 2024 07:03:46 -0400 Original-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 1sdSpt-0000Zl-C7 for help-gnu-emacs@gnu.org; Mon, 12 Aug 2024 07:03:37 -0400 Original-Received: from mail-oi1-x22b.google.com ([2607:f8b0:4864:20::22b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sdSpr-0000Dw-TY for help-gnu-emacs@gnu.org; Mon, 12 Aug 2024 07:03:37 -0400 Original-Received: by mail-oi1-x22b.google.com with SMTP id 5614622812f47-3db1956643bso3158816b6e.3 for ; Mon, 12 Aug 2024 04:03:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1723460614; x=1724065414; darn=gnu.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=9u4+f9JQqffA9fU8Ntc8mgfz3a8GsrGdEeS3cWuXT3Q=; b=d3QybhgDLndgsjFZPPYz8TmHeV+O2+gIVO1qqJFdN4AYvgvOOui475TAVIfrL9YpIU u2/9OG5anRmUNUlvFLsLKu740l12BBiQ62GFUz3Wdw4D8chml4Td3kNhaTzxOKMjZmSt cxx0dAvGiQeCE6c1xkbNO/gGtV1JqG4GfuHyWfplYWHqcKIAlcbkgQo5X8oMyNkglYqF 58W/yUqNxrnnjIxtrRcvsnrZEblwWzDdU/9x6kmDzxBWK6HYNIgfKSIkmrxmWt2mk3J2 M0FoZf2DCqzRX0uhe3n3YlHcPMObNA86iQaGx/auYrxjRKIhp/zEr0WKdGG4bQT6w2/k fWOg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1723460614; x=1724065414; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=9u4+f9JQqffA9fU8Ntc8mgfz3a8GsrGdEeS3cWuXT3Q=; b=tzqJNQyzKIvO5oSPJNGvcAEwgzgBSxhUlkmP7FQeLLtYskZUTjgSjjKuOOl5It6BtN XLeVQfTlUk1M/ZH/T+uEr8kEelGGVcfB5sHgnspHp5johE3iTKIahnYZ43R0uU/Ici4C NxkKBWdZxzEwhmcWGgqxg4KoMjsE/nfmHwpZ5X16OgdEDiiRBuAwLBkqZSkyI4Pv0uPF 2xEyLgYHr/WEd3kk/2z778KihgTj/D0UWckVkeoznFvLei3CiI3pbxD6GmmvF6jb6WyV kqLP85PeOACcctMQdnSnXE++7QjFLwg5nXMX/r3VqOvfbExPsZJgBjQc4NiVrW8/Xffz wI7g== X-Gm-Message-State: AOJu0YxVcSdMijXwJ8V5O1nW/i2ESAnaPF+L+wOrnU5tU+nMCk8MDJF1 /G9+TrPVyvSTjUvlhyE+93t9dvkQGZoxTRUhq7RYKBANb5c5Vv9yqvSEzOzsFrGS04NPjQwjSfs TOKyed9xnn5XIvbG6saIJ8srtvrf03nWD X-Google-Smtp-Source: AGHT+IFtyuM/JnPh8trZnLYRqVTC1J0Xo37XU7OPBowX/0hQhRFnpWUXYbx6Wl5SkMqhXYZldN818e/4VxuD2R2YURo= X-Received: by 2002:a05:6358:720f:b0:1ac:671c:d424 with SMTP id e5c5f4694b2df-1b19d2c5053mr3152155d.8.1723460614201; Mon, 12 Aug 2024 04:03:34 -0700 (PDT) In-Reply-To: <5my4_hPxAvHxrSRXBqG0sOdSxA9OXe9rRX9fl7efeXWgi5h6EAw4Oh3a7VllRQNz6URMUcjIPkRcOGMn6RCYxbF0Au7lTb2BCkm4ffPuv3A=@protonmail.com> Received-SPF: pass client-ip=2607:f8b0:4864:20::22b; envelope-from=yurivkhan@gmail.com; helo=mail-oi1-x22b.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.29 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-mx.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.help:147628 Archived-At: On Mon, 12 Aug 2024 at 17:09, Heime wrote: > > How can I change the regexp so that instead of the beginning ;;; > I use the comment character of the current buffer, replicated three > times ? > > (let ( (heading-regexp "^;;;\\s-+\\([HM][[:digit:]]\\)\\s-") You=E2=80=99re asking a homework question so here are hints that I would gi= ve someone who is struggling with homework. Do you already know how to get the comment character of the current buffer? Do you already know how to escape an arbitrary character for safe use in a regexp? Do you already know which part of the regexp you have is responsible for matching three semicolons? Do you already know how to concatenate strings?