]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix regex repetition of repetitions
authorPaul Eggert <eggert@cs.ucla.edu>
Thu, 5 Dec 2019 00:53:39 +0000 (16:53 -0800)
committerPaul Eggert <eggert@cs.ucla.edu>
Thu, 5 Dec 2019 00:54:24 +0000 (16:54 -0800)
Problems reported by Mattias EngdegĂ„rd in:
https://lists.gnu.org/r/emacs-devel/2019-12/msg00066.html
* lisp/gnus/gnus-util.el (gnus-emacs-version):
* lisp/mail/rfc2368.el (rfc2368-mailto-regexp):
* lisp/net/tramp-sh.el (tramp-sh-inotifywait-process-filter):
* lisp/obsolete/terminal.el (te-parse-program-and-args):
* lisp/org/org-table.el (org-table-wrap-region):
* lisp/progmodes/verilog-mode.el (verilog-inject-inst):
Avoid repetition-of-repetition in regexp.

lisp/gnus/gnus-util.el
lisp/mail/rfc2368.el
lisp/net/tramp-sh.el
lisp/obsolete/terminal.el
lisp/org/org-table.el
lisp/progmodes/verilog-mode.el

index 8e390473aa8725c40c0744abbae2ac1e79f9d92a..42021d307305e09db3c65157938e8ff849b043fb 100644 (file)
@@ -1574,7 +1574,7 @@ sequence, this is like `mapcar'.  With several, it is like the Common Lisp
     (cond
      ((not (memq 'emacs lst))
       nil)
-     ((string-match "^\\(\\([.0-9]+\\)*\\)\\.[0-9]+$" emacs-version)
+     ((string-match "^[.0-9]*\\.[0-9]+$" emacs-version)
       (concat "Emacs/" emacs-version
              (if system-v
                  (concat " (" system-v ")")
index 05f27e4d9989695112014bb81de538c6485fdfd4..b658ffab5870cc5d0963409d3c2f75d7b8678eea 100644 (file)
@@ -61,7 +61,7 @@
 ;; only an approximation?
 ;; see rfc 1738
 (defconst rfc2368-mailto-regexp
-  "^\\(mailto:\\)\\([^?]+\\)*\\(\\?\\(.*\\)\\)*"
+  "^\\(mailto:\\)\\([^?]+\\)?\\(\\?\\(.*\\)\\)*"
   "Regular expression to match and aid in parsing a mailto url.")
 
 ;; describes 'mailto:'
index 59a93a839e08a9468bbae24c005484eee51c4f2d..2aef6ea10fb8c7b343497e88ddb019eba8572abc 100644 (file)
@@ -3799,7 +3799,7 @@ Fall back to normal file name handler if no Tramp handler exists."
       (unless (string-match
               (eval-when-compile
                 (concat "^[^[:blank:]]+"
-                        "[[:blank:]]+\\([^[:blank:]]+\\)+"
+                        "[[:blank:]]+\\([^[:blank:]]+\\)"
                         "\\([[:blank:]]+\\([^\n\r]+\\)\\)?"))
               line)
        (tramp-error proc 'file-notify-error "%s" line))
index ce6f2309fd34464f428c763f3f73cef3f61f9cf9..c12d225beff37394e975abcb53bcbf1ed1368d3b 100644 (file)
@@ -1166,7 +1166,7 @@ subprocess started."
         (let ((l ()) (p 0))
           (while p
             (setq l (cons (if (string-match
-                               "\\([-a-zA-Z0-9+=_.@/:]+\\)\\([ \t]+\\)*"
+                               "\\([-a-zA-Z0-9+=_.@/:]+\\)[ \t]*"
                                s p)
                               (prog1 (substring s p (match-end 1))
                                 (setq p (match-end 0))
index a21587acbe0c053141ff20665c8cf957e0bdde98..5f42db50688729fa494d3887493153ed4dc5fd19 100644 (file)
@@ -4642,7 +4642,7 @@ blank, and the content is appended to the field above."
        (skip-chars-backward " ")
        (insert " " (org-trim s))
        (org-table-align)))
-     ((looking-at "\\([^|]+\\)+|")     ; Split field.
+     ((looking-at "\\([^|]+\\)|")      ; Split field.
       (let ((s (match-string 1)))
        (replace-match " |")
        (goto-char (match-beginning 0))
index 0afbdc3dd18e987cc7581882d3070946ff93c1c7..6ec8d995c15f639a90fe4bbcbeed297d83ab35f3 100644 (file)
@@ -10973,7 +10973,7 @@ shown) will make this into:
                (t
                 ;; Delete identical interconnect
                  (let ((case-fold-search nil))  ; So we don't convert upper-to-lower, etc
-                  (while (verilog-re-search-forward-quick "\\.\\s *\\([a-zA-Z0-9`_$]+\\)*\\s *(\\s *\\1\\s *)\\s *" end-pt t)
+                  (while (verilog-re-search-forward-quick "\\.\\s *\\([a-zA-Z0-9`_$]+\\)?\\s *(\\s *\\1\\s *)\\s *" end-pt t)
                     (delete-region (match-beginning 0) (match-end 0))
                      (setq end-pt (- end-pt (- (match-end 0) (match-beginning 0))))  ; Keep it correct
                     (while (or (looking-at "[ \t\n\f,]+")