From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Samvid Mistry Newsgroups: gmane.emacs.help Subject: Regex matching summary blocks in C# Date: Sun, 03 Dec 2023 17:37:51 +0530 Message-ID: Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="35812"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: mu4e 1.10.7; emacs 29.1 To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Sun Dec 03 13:20:51 2023 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 1r9lSs-0009D4-DE for geh-help-gnu-emacs@m.gmane-mx.org; Sun, 03 Dec 2023 13:20:50 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1r9lS8-0003k5-Dy; Sun, 03 Dec 2023 07:20:04 -0500 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 1r9lS6-0003jT-8R for help-gnu-emacs@gnu.org; Sun, 03 Dec 2023 07:20:02 -0500 Original-Received: from mail-pf1-x431.google.com ([2607:f8b0:4864:20::431]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1r9lS3-00054c-Mq for help-gnu-emacs@gnu.org; Sun, 03 Dec 2023 07:20:01 -0500 Original-Received: by mail-pf1-x431.google.com with SMTP id d2e1a72fcca58-6ce3534bf44so563787b3a.1 for ; Sun, 03 Dec 2023 04:19:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1701605995; x=1702210795; darn=gnu.org; h=mime-version:message-id:date:subject:to:from:user-agent:from:to:cc :subject:date:message-id:reply-to; bh=YDcmBqYszNBr5a59qIrwDySTlWwMqUnpeZTeTYvXfL8=; b=EJI+lv7OVRB54p+Lf/GcZCNZFRg8RDlQlmz2MWKRYQwsgOJUu3DDqBpvC1TcBr/1ep YOwawDpYDeAzyXL5FQzC6oFJqLYh20YGRVbv1MkBsu3MCATR4MeNnIAaJauYnHlqwEln lb+aNhGWCfew3wNscbUMqTfumZE3QHccBmz2p8PQQWZA8ThTIcvWVZUtzDHfjvXGc3LK z9rPKB72duSN/PVXMlWHlT/3q0zhljB2mkKIfLFhATtPYljEgq9vn5HDkipZqNNLZwgS 4HxPr9I2hmKfeA1qJxuCXVLXiTiG0EcBMs5beTo1rMs8vEkaB0ctxeDc+AbRDyGtizxV SFJg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701605995; x=1702210795; h=mime-version:message-id:date:subject:to:from:user-agent :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=YDcmBqYszNBr5a59qIrwDySTlWwMqUnpeZTeTYvXfL8=; b=vhhk5VjTNgTazMS11b94C8rOhRxLTg5V0zOX2Le1JrnIIbM7ik+RtA6JX4zWqPkn2Y /2qpUCQGrio4TgUFKt3+cFsN/59JcXkAFENiGHYV1EjCEBsBvuAkMei4xmIHL6KNFPFs nD6dZOU6AxnBVd4Pxu7y6OG5cOYtbpnohAE9KYioaKiurcClWoY96s1+hFrvCCEjbag3 qpcvjARr/rfQ96KFg3rkfA6CxfZXW1Nqv8q3M2RcTCZKD7uN8xecdoRNoBEbvnloI2cT QxK3Ui3qTAAKwtsrv7Z2RvAFEELI1+tbzS9k52YC7BEJjWS2Okux4iQ0gxsPI10PbLEs bFxA== X-Gm-Message-State: AOJu0YyREj0HN+YrIyBrotr7yo5wLNsubquwJbwXW2wF2mjLm6VYP2AB Y1USHs8aXM8fdQgrH85xFyuONqlDMJc= X-Google-Smtp-Source: AGHT+IFyCLi9GlfhJO7dH0YyFoxa8BvWs152KDVLxN6kJrMXquROrXUqcZa8vAl17BBFuS52VwMSVQ== X-Received: by 2002:a05:6a20:8e1f:b0:13f:13cb:bc50 with SMTP id y31-20020a056a208e1f00b0013f13cbbc50mr2928168pzj.25.1701605995341; Sun, 03 Dec 2023 04:19:55 -0800 (PST) Original-Received: from Samvids-MacBook-Pro.local ([103.251.58.130]) by smtp.gmail.com with ESMTPSA id e21-20020a62aa15000000b006c03f58b5b1sm5933306pff.59.2023.12.03.04.19.53 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 03 Dec 2023 04:19:54 -0800 (PST) Received-SPF: pass client-ip=2607:f8b0:4864:20::431; envelope-from=mistrysamvid@gmail.com; helo=mail-pf1-x431.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:145607 Archived-At: Hey, I am trying to write an overlay that will simplify the large `` blocks around comments in C# and just keep the content. For example, ``` /// /// Gets the value of the counter. /// ``` will get simplified to just ``` // Gets the value of the counter. ``` I have written a regex that can match the summary blocks, that is "\\(\\s-*\\)///\\s-*\\s-*\n\\(.*\n\\)*?\\s-*///\\s-*" The first group captures the indentation so that the overlay is indented properly. The second group is supposed to capture the text of the block. It works fine for single line blocks but for block spanning multiple lines, the second capture group only captures the last line of comment. The remaining lines get captured by `///\\s-*\\s-*\n` somehow. For example, in ``` /// /// Initializes a new instance of the /// /// class. /// ``` the second capture group only captures ` /// class.` and all lines above it are captured by the former part of the regex. Not sure what I am doing wrong here. I haven't put any wildcards that will capture anything other than whitespace around summary tag. Appreciate any help with this. PS: This is my first time using any mailing list. Let me know if I should be following any conventions while posting. -- Thanks, Samvid