diff options
author | Bill Wohler <wohler@newt.com> | 2014-02-23 18:04:35 -0800 |
---|---|---|
committer | Bill Wohler <wohler@newt.com> | 2014-02-23 18:04:35 -0800 |
commit | 3e93bafb95608467e438ba7f725fd1f020669f8c (patch) | |
tree | f2f90109f283e06a18caea3cb2a2623abcfb3a92 /lisp/emacs-lisp/regexp-opt.el | |
parent | 791c0d7634e44bb92ca85af605be84ff2ae08963 (diff) | |
parent | e918e27fdf331e89268fc2c9d7cf838d3ecf7aa7 (diff) | |
download | emacs-3e93bafb95608467e438ba7f725fd1f020669f8c.tar.gz |
Merge from trunk; up to 2014-02-23T23:41:17Z!lekktu@gmail.com.
Diffstat (limited to 'lisp/emacs-lisp/regexp-opt.el')
-rw-r--r-- | lisp/emacs-lisp/regexp-opt.el | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/lisp/emacs-lisp/regexp-opt.el b/lisp/emacs-lisp/regexp-opt.el index de9966c0af0..b2d4f2b71dd 100644 --- a/lisp/emacs-lisp/regexp-opt.el +++ b/lisp/emacs-lisp/regexp-opt.el @@ -1,9 +1,9 @@ ;;; regexp-opt.el --- generate efficient regexps to match strings -;; Copyright (C) 1994-2013 Free Software Foundation, Inc. +;; Copyright (C) 1994-2014 Free Software Foundation, Inc. ;; Author: Simon Marshall <simon@gnu.org> -;; Maintainer: FSF +;; Maintainer: emacs-devel@gnu.org ;; Keywords: strings, regexps, extensions ;; This file is part of GNU Emacs. @@ -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) |