diff options
author | Eli Zaretskii <eliz@gnu.org> | 2013-12-07 19:21:57 +0200 |
---|---|---|
committer | Eli Zaretskii <eliz@gnu.org> | 2013-12-07 19:21:57 +0200 |
commit | ce1d7b61f12dcc1b67535b68d9b0655b45fcadb6 (patch) | |
tree | 881d03f4f486933482cd2e3851184cd3b172ef1b /lisp/emacs-lisp/regexp-opt.el | |
parent | 6630df25238c5a1efa2bc6a0fa7889782e8c91b5 (diff) | |
parent | fa6fa1a1773f255b5efbe52a743b017f4908a6cb (diff) | |
download | emacs-ce1d7b61f12dcc1b67535b68d9b0655b45fcadb6.tar.gz emacs-ce1d7b61f12dcc1b67535b68d9b0655b45fcadb6.tar.bz2 emacs-ce1d7b61f12dcc1b67535b68d9b0655b45fcadb6.zip |
Merge from trunk.
Diffstat (limited to 'lisp/emacs-lisp/regexp-opt.el')
-rw-r--r-- | lisp/emacs-lisp/regexp-opt.el | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/lisp/emacs-lisp/regexp-opt.el b/lisp/emacs-lisp/regexp-opt.el index de9966c0af0..cb7828ddd95 100644 --- a/lisp/emacs-lisp/regexp-opt.el +++ b/lisp/emacs-lisp/regexp-opt.el @@ -285,7 +285,9 @@ CHARS should be a list of characters." ;; ;; Make sure a caret is not first and a dash is first or last. (if (and (string-equal charset "") (string-equal bracket "")) - (concat "[" dash caret "]") + (if (string-equal dash "") + "\\^" ; [^] is not a valid regexp + (concat "[" dash caret "]")) (concat "[" bracket charset caret dash "]")))) (provide 'regexp-opt) |