From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Michael Heerdegen Newsgroups: gmane.emacs.help Subject: Re: how to use a variable inside Emacs regex features ? Date: Thu, 23 May 2019 18:37:04 +0200 Message-ID: <87woih161b.fsf@web.de> References: <7bb10774-01c5-402c-9924-1e7c23f32358@default> <20190523065308.GA28035@tuxteam.de> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="170911"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) Cc: help-gnu-emacs@gnu.org To: Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu May 23 18:53:23 2019 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hTqy3-000iIN-BO for geh-help-gnu-emacs@m.gmane.org; Thu, 23 May 2019 18:53:23 +0200 Original-Received: from localhost ([127.0.0.1]:40645 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hTqy2-0004X6-3p for geh-help-gnu-emacs@m.gmane.org; Thu, 23 May 2019 12:53:22 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:44856) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hTqvP-0002RZ-Fl for help-gnu-emacs@gnu.org; Thu, 23 May 2019 12:50:40 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hTqiW-0004qP-JA for help-gnu-emacs@gnu.org; Thu, 23 May 2019 12:37:22 -0400 Original-Received: from mout.web.de ([212.227.15.4]:55733) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hTqiU-0004jV-H0 for help-gnu-emacs@gnu.org; Thu, 23 May 2019 12:37:20 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=web.de; s=dbaedf251592; t=1558629425; bh=+ER1UTMkpkn41Xq7ND+aqUrvCk0jVR1QAlwpZb3JWRg=; h=X-UI-Sender-Class:From:To:Cc:Subject:References:Date:In-Reply-To; b=DVh71mCXwcE9jGg6I23WZaTXxc8QEh0MHIkgfegkdzSV04N7/K1yoV2qW1fkV1Kmo LBbOsBAPuq6EXKQAFG2dp0ewYusw2VVv4gJ2JVe3JYvz2tlaX37c4cr9E/Rh8NQIV8 NgW6aV42UlYfq31ewqzxA05Batz3v/rume9OW9d0= X-UI-Sender-Class: c548c8c5-30a9-4db5-a2e7-cb6cb037b8f9 Original-Received: from drachen.dragon ([188.110.143.34]) by smtp.web.de (mrweb002 [213.165.67.108]) with ESMTPSA (Nemesis) id 0LaTpn-1gmZ4Q39NH-00mH0j; Thu, 23 May 2019 18:37:05 +0200 In-Reply-To: <20190523065308.GA28035@tuxteam.de> (tomas@tuxteam.de's message of "Thu, 23 May 2019 08:53:08 +0200") X-Provags-ID: V03:K1:bPSqrUTdVCiadSME/GAJ5p75n9Y6LfHlZAM9+B9gImjw7ckz+dx odwNzO2x26P3dd82GquNaxz00kv1HcC7gtd+rQbRSuqkBed5JTJWczHlLSpkcpee2kLB2DZ Y/HRqUKpz9sfEA/Vk/vPF4RdWU8+kP5qwk4GpSG8AltF6vtw7rTkuYoUHNtScswrf/l+W8M lNNSux6nM/wEhlaNzdUrw== X-UI-Out-Filterresults: notjunk:1;V03:K0:REbB/L93ScM=:E1Cyvyl+S7VyfSEAkXaU3C 11jZ3+k/tKa0JPiTc+eLvw7LsDg4xf4D69rJBdhVB+ebiiRdymdIkeBj/KZJsS3UiA6yr8Qfu JtMsuyYYv44h1xxpvt1wa8lrrpJ6iMTItJIK74F0I9aUZMaf7lnHWeOQt+ZFJgUNJizUwcQ+J TqyHH8IxdNUS9QuhfFwakp6Nvjab0lbZ7L8dQgk/I6i0HYIIQCZgWM42v0s9QQQTc/U/fcQNs 1Kg6Jq4DcC01G2CIxOKttFv20fJr7UfpPsuBRpsB+kJiGabmvIDEnoASjNwcgidwRyWG5QFo8 DytD4qpIEprAvimeY16bI7e1nIPlHCWt/11dIYXHA227+MEjS6oCZKCPRX+ZdX2Y6TX+tNzxN bT9b2I65ZXxseE5WCJA6G9Hv4vPmur98kx3CZYB0cJ3eIFTK3xBEo0J9Wbasxx3zp65Vf7nIl e5OMx6hCEuR+iJlc6TFnyAYxiF593buGCpg+bkEkIF5oG9xHglq45CXybRSEd+aBtslhEVycj HQQevwbjVXvZzsRFMqrp8qjc2rTgKcOXpn1OCs1HNsHt0UpWSvoTkhnLw3Vdlht4JYisO+I8k eTYnd/iQE8cdu0ydT3RLYODBDyHNtF3fi8uU4z199QkdjjkCBTnNvHPOleVlbFBiqX2kFzTgL 9vJpyOgU9Ms7JTGT1zb4yZJUy9ZPUnD0MGTRrX026cC7NYCE+1Vz8NNVBQ7GsMD9WsxxdJN1d naNZSofj0soDHVoBx//U7J9ok/UdhADsiX0SOEGKUptXmkvhmjtJQQeaHNWfh9fRZRHn8KJK X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 212.227.15.4 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.21 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.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.org gmane.emacs.help:120585 Archived-At: writes: > If you are doing more complex things, you might like 'rx', which > allows you to write regular expressions in S-expression syntax, > thus giving you access to template macros and all that goodness. This is a task for rx indeed - or rx-to-string when the regexp depends on the run-time value of a variable: (let ((ntimes 8)) (re-search-forward (rx-to-string `(= ,ntimes "hello")))) Michael.