[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Experimental regexp check: repetition of empty-matching expression
From: |
Mattias Engdegård |
Subject: |
Re: Experimental regexp check: repetition of empty-matching expression |
Date: |
Sat, 13 Apr 2019 10:09:57 +0200 |
13 apr. 2019 kl. 04.47 skrev Paul Eggert <address@hidden>:
>
> I think it's useful, except that the last entry (in dabbrev.el) seems to be a
> false alarm, as a regexp pattern is initially nil but is assigned something
> else before use, and the trawler assumes it's nil.
Yes, I couldn't make up my mind about the best way to suppress that one.
Ignoring repetitions of the empty string, like \(?:\)*, may be the answer.
> I installed the attached patch into master to fix the other issues as best I
> could. Thanks.
That was quick work!
--- a/lisp/mail/mail-extr.el
+++ b/lisp/mail/mail-extr.el
@@ -383,7 +383,7 @@ mail-extr-initial-pattern
;; Matches telephone extensions.
(defconst mail-extr-telephone-extension-pattern
(purecopy
- "\\(\\([Ee]xt\\|\\|[Tt]ph\\|[Tt]el\\|[Xx]\\).?\\)? *\\+?[0-9][- 0-9]+"))
+ "\\(\\([Ee]xt\\|[Tt]ph\\|[Tt]el\\|[Xx]\\).?\\)? *\\+?[0-9][- 0-9]+"))
^
Doesn't it look like the dot is meant to be escaped?
--- a/lisp/net/tramp-adb.el
+++ b/lisp/net/tramp-adb.el
@@ -53,7 +53,7 @@ tramp-adb-method
"When this method name is used, forward all calls to Android Debug Bridge.")
(defcustom tramp-adb-prompt
-
"^\\(?:[[:digit:]]*|?\\)?\\(?:[[:alnum:]\e;address@hidden:alnum:]]*[^#\\$]*\\)?[#\\$][[:space:]]"
+
"^[[:digit:]]*|?\\(?:[[:alnum:]\e;address@hidden:alnum:]]*[^#\\$]*\\)?[#\\$][[:space:]]"
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
There is a second one a bit later in the same regexp.