git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH 1/2] Remove archaic use of regex capture \1 in favour of $1

From
NWNick Woolley <nick@noodlefactory.co.uk>
Date
Jul 6, 2009, 13:33 UTC
Message-ID
<4A51FD13.3030708@noodlefactory.co.uk>
Using it will generate a perl warning "\1 better written as $1".
Signed-off-by: Nick Woolley <git.wu-lee@noodlefactory.co.uk>
---
 git-cvsexportcommit.perl |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/git-cvsexportcommit.perl b/git-cvsexportcommit.perl
index a36df33..d509468 100755
--- a/git-cvsexportcommit.perl
+++ b/git-cvsexportcommit.perl
@@ -299,7 +299,7 @@ foreach my $f (@files) {
 	while (<FILTER_IN>)
 	{
 	    my $line = $_;
-	    $line =~ s/\$([A-Z][a-z]+):[^\$]+\$/\$\1\$/g;
+	    $line =~ s/\$([A-Z][a-z]+):[^\$]+\$/\$$1\$/g;
 	    print FILTER_OUT $line;
 	}
 	close FILTER_IN;
-- 
1.6.3.3
Message 1 of 1 in “Remove archaic use of regex capture \1 in favour of $1”
  1. 1/2 Remove archaic use of regex capture \1 in favour of $1Nick Woolley, Jul 6, 2009

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.