You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by to...@apache.org on 2022/07/31 05:11:37 UTC

[lucene-jira-archive] branch main updated: use non-greedy match for capturing mentions

This is an automated email from the ASF dual-hosted git repository.

tomoko pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/lucene-jira-archive.git


The following commit(s) were added to refs/heads/main by this push:
     new 3b8b9cb0 use non-greedy match for capturing mentions
3b8b9cb0 is described below

commit 3b8b9cb01e33a562412dce923580cb6cc68e8986
Author: Tomoko Uchida <to...@gmail.com>
AuthorDate: Sun Jul 31 14:11:06 2022 +0900

    use non-greedy match for capturing mentions
---
 migration/src/jira_util.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/migration/src/jira_util.py b/migration/src/jira_util.py
index 505a3369..69f919d7 100644
--- a/migration/src/jira_util.py
+++ b/migration/src/jira_util.py
@@ -228,8 +228,8 @@ JIRA_EMOJI_TO_UNICODE = {
 
 REGEX_CRLF = re.compile(r"\r\n")
 REGEX_JIRA_KEY = re.compile(r"[^/]LUCENE-\d+")
-REGEX_MENTION_ATMARK = re.compile(r"(^@[\w\.@_-]+)|((?<=[\s\(\"'])@[\w\.@_-]+)(?=[\s\)\"'\?!,;:\.$])")  # this regex may capture only "@" + "<username>" mentions
-REGEX_MENION_TILDE = re.compile(r"(^\[~[\w\.@_-]+\])|((?<=[\s\(\"'])\[~[\w\.@_-]+\])(?=[\s\)\"'\?!,;:\.$])")  # this regex may capture only "[~" + "<username>" + "]" mentions
+REGEX_MENTION_ATMARK = re.compile(r"(^@[\w\.@_-]+?)|((?<=[\s\(\"'])@[\w\.@_-]+?)(?=[\s\)\"'\?!,;:\.$])")  # this regex may capture only "@" + "<username>" mentions
+REGEX_MENION_TILDE = re.compile(r"(^\[~[\w\.@_-]+?\])|((?<=[\s\(\"'])\[~[\w\.@_-]+?\])(?=[\s\)\"'\?!,;:\.$])")  # this regex may capture only "[~" + "<username>" + "]" mentions
 REGEX_LINK = re.compile(r"\[([^\]]+)\]\(([^\)]+)\)")