]> git.eshelyaron.com Git - emacs.git/commitdiff
Replace manually crafted hex regexes with [:xdigit:]
authorKonstantin Kharlamov <Hi-Angel@yandex.ru>
Thu, 13 Jun 2019 00:18:43 +0000 (03:18 +0300)
committerEli Zaretskii <eliz@gnu.org>
Sat, 6 Jul 2019 07:54:25 +0000 (10:54 +0300)
* admin/charsets/mapconv:
* build-aux/gitlog-to-changelog (parse_amend_file, git_dir_option):
* lisp/progmodes/verilog-mode.el (verilog-delay-re):
(verilog-type-font-keywords, verilog-read-always-signals-recurse):
(verilog-is-number):
* lisp/progmodes/vera-mode.el (vera-font-lock-keywords):
* test/src/emacs-module-tests.el (mod-test-sum-test):
* lisp/xml.el: (xml--entity-replacement-text):
* lisp/version.el (emacs-repository-version-git):
* lisp/textmodes/sgml-mode.el (sgml-quote):
* lisp/textmodes/css-mode.el (css-escapes-re)
(css--colors-regexp):
* lisp/progmodes/prolog.el (prolog-syntax-propertize-function):
* lisp/progmodes/hideif.el (hif-token-regexp, hif-tokenize):
* lisp/progmodes/ebnf-dtd.el: (ebnf-dtd-attlistdecl)
(ebnf-dtd-entitydecl, ebnf-dtd-lex):
* lisp/progmodes/ebnf-ebx.el (ebnf-ebx-hex-character):
* lisp/progmodes/ebnf-abn.el (ebnf-abn-character):
* lisp/progmodes/cperl-mode.el (cperl-highlight-charclass)
(cperl-find-pods-heres):
* lisp/progmodes/cc-mode.el (c-maybe-quoted-number-head)
(c-maybe-quoted-number, c-parse-quotes-before-change)
(c-parse-quotes-after-change, c-quoted-number-head-before-point)
(c-quoted-number-straddling-point):
* lisp/progmodes/ada-mode.el (featurep, ada-in-numeric-literal-p)
(ada-font-lock-keywords):
* lisp/org/org-mobile.el (org-mobile-copy-agenda-files)
* lisp/org/org-table.el (org-table-number-regexp):
(org-mobile-update-checksum-for-capture-file):
* lisp/nxml/xsd-regexp.el (xsdre-gen-categories):
* lisp/nxml/xmltok.el (let*):
* lisp/nxml/rng-xsd.el (rng-xsd-convert-hex-binary)
(rng-xsd-convert-any-uri):
* lisp/nxml/rng-uri.el (rng-uri-file-name-1)
(rng-uri-unescape-multibyte, rng-uri-unescape-unibyte)
(rng-uri-unescape-unibyte-match)
(rng-uri-unescape-unibyte-replace):
* lisp/nxml/rng-cmpct.el (rng-c-process-escapes):
* lisp/nxml/nxml-maint.el (nxml-insert-target-repertoire-glyph-set):
* lisp/net/shr-color.el (shr-color->hexadecimal):
* lisp/mail/rfc2231.el (rfc2231-decode-encoded-string):
* lisp/international/mule-cmds.el (read-char-by-name):
* lisp/htmlfontify.el (hfy-hex-regex):
* lisp/gnus/nneething.el (nneething-decode-file-name):
* lisp/gnus/mml-sec.el (mml-secure-find-usable-keys):
* lisp/gnus/gnus-art.el (gnus-button-mid-or-mail-heuristic-alist):
* lisp/faces.el (read-color):
* lisp/epg.el (epg--status-ERRSIG, epg--status-VALIDSIG)
(epg--status-SIG_CREATED, epg--decode-percent-escape)
(epg--decode-hexstring, epg--decode-quotedstring)
(epg-dn-from-string):
* lisp/emulation/cua-rect.el (cua-incr-rectangle):
* lisp/dnd.el (dnd-unescape-uri):
* lisp/cedet/semantic/lex.el (semantic-lex-number-expression):
* lisp/cedet/semantic/java.el (semantic-java-number-regexp):
* lisp/calc/calc-lang.el (pascal):
* lisp/calc/calc-ext.el (math-read-number-fancy):
* lisp/calc/calc-aent.el (math-read-token):
Replace various combinations of [0-9a-fA-F] with [[:xdigit:]].
(Bug#36167)

41 files changed:
admin/charsets/mapconv
build-aux/gitlog-to-changelog
lisp/calc/calc-aent.el
lisp/calc/calc-ext.el
lisp/calc/calc-lang.el
lisp/cedet/semantic/java.el
lisp/cedet/semantic/lex.el
lisp/dnd.el
lisp/emulation/cua-rect.el
lisp/epg.el
lisp/faces.el
lisp/gnus/gnus-art.el
lisp/gnus/mml-sec.el
lisp/gnus/nneething.el
lisp/htmlfontify.el
lisp/international/mule-cmds.el
lisp/mail/rfc2231.el
lisp/net/shr-color.el
lisp/nxml/nxml-maint.el
lisp/nxml/rng-cmpct.el
lisp/nxml/rng-uri.el
lisp/nxml/rng-xsd.el
lisp/nxml/xmltok.el
lisp/nxml/xsd-regexp.el
lisp/org/org-mobile.el
lisp/org/org-table.el
lisp/progmodes/ada-mode.el
lisp/progmodes/cc-mode.el
lisp/progmodes/cperl-mode.el
lisp/progmodes/ebnf-abn.el
lisp/progmodes/ebnf-dtd.el
lisp/progmodes/ebnf-ebx.el
lisp/progmodes/hideif.el
lisp/progmodes/prolog.el
lisp/progmodes/vera-mode.el
lisp/progmodes/verilog-mode.el
lisp/textmodes/css-mode.el
lisp/textmodes/sgml-mode.el
lisp/version.el
lisp/xml.el
test/src/emacs-module-tests.el

index 8e19972f3dfbc5ab88b749ec107ef3fd8b0dc140..2696b13a52e8e0549aa9d202c57fb09b128e3624 100755 (executable)
@@ -118,7 +118,7 @@ elif [ "$3" = "IANA" ] ; then
     # Source format is:
     #   0xXX   0xYYYY
     sed -n -e "${2}p" < $1 \
-       | sed -e 's/\(0x[0-9A-Fa-f]*\)[^0]*\(0x[0-9A-Fa-f]*\).*/\1 \2/' \
+       | sed -e 's/\(0x[[:xdigit:]]*\)[^0]*\(0x[[:xdigit:]]*\).*/\1 \2/' \
        | sort | ${AWKPROG}
 elif [ "$3" = "UNICODE" ] ; then
     # Source format is:
index 3acfa8b4c5b67bc050e587470eac9987cc862f00..163c48c8e215508e7e702096c10765eae0a3c064 100755 (executable)
@@ -189,7 +189,7 @@ sub parse_amend_file($)
 
       if (!$in_code)
         {
-          $line =~ /^([0-9a-fA-F]{40})$/
+          $line =~ /^([[:xdigit:]]{40})$/
             or (warn "$ME: $f:$.: invalid line; expected an SHA1\n"),
               $fail = 1, next;
           $sha = lc $1;
@@ -303,7 +303,7 @@ sub git_dir_option($)
       my ($sha, $rest) = split ':', $log, 2;
       defined $sha
         or die "$ME:$.: malformed log entry\n";
-      $sha =~ /^[0-9a-fA-F]{40}$/
+      $sha =~ /^[[:xdigit:]]{40}$/
         or die "$ME:$.: invalid SHA1: $sha\n";
 
       my $skipflag = 0;
@@ -391,7 +391,7 @@ sub git_dir_option($)
                   @skipshas = ();
                   next;
               }
-              if ($found && $_ =~ /^([0-9a-fA-F]{7,}) [^ ]/)
+              if ($found && $_ =~ /^([[:xdigit:]]{7,}) [^ ]/)
               {
                   push ( @skipshas, $1 );
               }
index a03bd6039cccf64fe5277695075e11e5673c634e..f7731c95fc0c2f87798670e8580d93fc02e48bd7 100644 (file)
@@ -728,7 +728,7 @@ in Calc algebraic input.")
                                                 math-exp-str (1- math-exp-pos))
                                   (1- math-exp-pos))))))
             (or (and (memq calc-language calc-lang-c-type-hex)
-                     (eq (string-match "0[xX][0-9a-fA-F]+" math-exp-str
+                     (eq (string-match "0[xX][[:xdigit:]]+" math-exp-str
                                         math-exp-pos)
                           math-exp-pos))
                 (string-match "_?\\([0-9]+.?0*@ *\\)?\\([0-9]+.?0*' *\\)?\\(0*\\([2-9]\\|1[0-4]\\)\\(#[#]?\\|\\^\\^\\)[0-9a-dA-D.]+[eE][-+_]?[0-9]+\\|0*\\([2-9]\\|[0-2][0-9]\\|3[0-6]\\)\\(#[#]?\\|\\^\\^\\)[0-9a-zA-Zα-ωΑ-Ω:.]+\\|[0-9]+:[0-9:]+\\|[0-9.]+\\([eE][-+_]?[0-9]+\\)?\"?\\)?"
index 43360fc976fd86ca9276c0dceb8a035304e76618..203625873a5248fd309646eadc637ee9a779da9d 100644 (file)
@@ -2967,13 +2967,13 @@ If X is not an error form, return 1."
 
    ;; C language hexadecimal notation
    ((and (eq calc-language 'c)
-        (string-match "^0[xX]\\([0-9a-fA-F]+\\)$" s))
+        (string-match "^0[xX]\\([[:xdigit:]]+\\)$" s))
     (let ((digs (math-match-substring s 1)))
       (math-read-radix digs 16)))
 
    ;; Pascal language hexadecimal notation
    ((and (eq calc-language 'pascal)
-        (string-match "^\\$\\([0-9a-fA-F]+\\)$" s))
+        (string-match "^\\$\\([[:xdigit:]]+\\)$" s))
     (let ((digs (math-match-substring s 1)))
       (math-read-radix digs 16)))
 
index ee107df39c1a3abce5bef87cc80bbe08e215a563..4a9771d7438545fe8ad98be7a9f1a68c70f021b4 100644 (file)
 (put 'pascal 'math-lang-read-symbol
      '((?\$
         (eq (string-match
-             "\\(\\$[0-9a-fA-F]+\\)\\($\\|[^0-9a-zA-Zα-ωΑ-Ω]\\)"
+             "\\(\\$[[:xdigit:]]+\\)\\($\\|[^0-9a-zA-Zα-ωΑ-Ω]\\)"
              math-exp-str math-exp-pos)
             math-exp-pos)
         (setq math-exp-token 'number
index 54cce9654592ab3312f9cccd0c8f151d1973a914..7f9c93b906ff0a5cdedf15fccd87f2cebfeaca5f 100644 (file)
@@ -51,7 +51,7 @@
             "\\|"
             "\\<[0-9]+[eE][-+]?[0-9]+[fFdD]?\\>"
             "\\|"
-            "\\<0[xX][0-9a-fA-F]+[lL]?\\>"
+            "\\<0[xX][[:xdigit:]]+[lL]?\\>"
             "\\|"
             "\\<[0-9]+[lLfFdD]?\\>"
             "\\)"
@@ -63,7 +63,7 @@ DECIMAL_LITERAL:
     [1-9][0-9]*
   ;
 HEX_LITERAL:
-    0[xX][0-9a-fA-F]+
+    0[xX][[:xdigit:]]+
   ;
 OCTAL_LITERAL:
     0[0-7]*
index 8dbc9e7ae830a9bfe2a7407e693e9160e50da3dd..a6ee869c037eb43c3ebd4c6b861dc474e335a558 100644 (file)
@@ -596,7 +596,7 @@ may need to be overridden for some special languages.")
             "\\|"
             "\\<[0-9]+[eE][-+]?[0-9]+[fFdD]?\\>"
             "\\|"
-            "\\<0[xX][0-9a-fA-F]+[lL]?\\>"
+            "\\<0[xX][[:xdigit:]]+[lL]?\\>"
             "\\|"
             "\\<[0-9]+[lLfFdD]?\\>"
             "\\)"
@@ -609,7 +609,7 @@ DECIMAL_LITERAL:
     [1-9][0-9]*
   ;
 HEX_LITERAL:
-    0[xX][0-9a-fA-F]+
+    0[xX][[:xdigit:]]+
   ;
 OCTAL_LITERAL:
     0[0-7]*
index 459a7238dcd8f5a50b20888542657e2b5718a675..973af7e518b570c356c3c9fbb287451988bac05b 100644 (file)
@@ -138,7 +138,7 @@ Return nil if URI is not a local file."
 
 (defsubst dnd-unescape-uri (uri)
   (replace-regexp-in-string
-   "%[A-Fa-f0-9][A-Fa-f0-9]"
+   "%[[:xdigit:]][[:xdigit:]]"
    (lambda (arg)
      (let ((str (make-string 1 0)))
        (aset str 0 (string-to-number (substring arg 1) 16))
index 706634a50172480166aa0db39f7e02b79dd86799..1a19cc2910e89042bc6ed80999a3d327b9b379f6 100644 (file)
@@ -1127,7 +1127,7 @@ The length of STRING need not be the same as the rectangle width."
   (cua--rectangle-operation 'keep nil t 1 nil
      (lambda (_s e _l _r)
         (cond
-         ((re-search-forward "0x\\([0-9a-fA-F]+\\)" e t)
+         ((re-search-forward "0x\\([[:xdigit:]]+\\)" e t)
           (let* ((txt (cua--filter-buffer-noprops (match-beginning 1) (match-end 1)))
                  (n (string-to-number txt 16))
                  (fmt (format "0x%%0%dx" (length txt))))
index a8b5a408a89254c0b47b631306031e0a07e2e75f..8029bf5a9318a39c1225a601ec614f1a57d2e943 100644 (file)
@@ -952,7 +952,7 @@ callback data (if any)."
 
 (defun epg--status-ERRSIG (context string)
   (if (string-match "\\`\\([^ ]+\\) \\([0-9]+\\) \\([0-9]+\\) \
-\\([0-9A-Fa-f][0-9A-Fa-f]\\) \\([^ ]+\\) \\([0-9]+\\)"
+\\([[:xdigit:]][[:xdigit:]]\\) \\([^ ]+\\) \\([0-9]+\\)"
                    string)
       (let ((signature (epg-make-signature 'error)))
        (epg-context-set-result-for
@@ -976,7 +976,7 @@ callback data (if any)."
     (when (and signature
               (eq (epg-signature-status signature) 'good)
               (string-match "\\`\\([^ ]+\\) [^ ]+ \\([^ ]+\\) \\([^ ]+\\) \
-\\([0-9]+\\) [^ ]+ \\([0-9]+\\) \\([0-9]+\\) \\([0-9A-Fa-f][0-9A-Fa-f]\\) \
+\\([0-9]+\\) [^ ]+ \\([0-9]+\\) \\([0-9]+\\) \\([[:xdigit:]][[:xdigit:]]\\) \
 \\(.*\\)"
                           string))
       (setf (epg-signature-fingerprint signature)
@@ -1146,7 +1146,7 @@ callback data (if any)."
 
 (defun epg--status-SIG_CREATED (context string)
   (if (string-match "\\`\\([DCS]\\) \\([0-9]+\\) \\([0-9]+\\) \
-\\([0-9A-Fa-f][0-9A-Fa-f]\\) \\(.*\\) " string)
+\\([[:xdigit:]][[:xdigit:]]\\) \\(.*\\) " string)
       (epg-context-set-result-for
        context 'sign
        (cons (epg-make-new-signature
@@ -2022,7 +2022,7 @@ If you are unsure, use synchronous version of this function
 (defun epg--decode-percent-escape (string)
   (setq string (string-to-unibyte string))
   (let ((index 0))
-    (while (string-match "%\\(\\(%\\)\\|\\([0-9A-Fa-f][0-9A-Fa-f]\\)\\)"
+    (while (string-match "%\\(\\(%\\)\\|\\([[:xdigit:]][[:xdigit:]]\\)\\)"
                         string index)
       (if (match-beginning 2)
          (setq string (replace-match "%" t t string)
@@ -2039,7 +2039,7 @@ If you are unsure, use synchronous version of this function
 
 (defun epg--decode-hexstring (string)
   (let ((index 0))
-    (while (eq index (string-match "[0-9A-Fa-f][0-9A-Fa-f]" string index))
+    (while (eq index (string-match "[[:xdigit:]][[:xdigit:]]" string index))
       (setq string (replace-match (string (string-to-number
                                           (match-string 0 string) 16))
                                  t t string)
@@ -2049,7 +2049,7 @@ If you are unsure, use synchronous version of this function
 (defun epg--decode-quotedstring (string)
   (let ((index 0))
     (while (string-match "\\\\\\(\\([,=+<>#;\\\"]\\)\\|\
-\\([0-9A-Fa-f][0-9A-Fa-f]\\)\\)"
+\\([[:xdigit:]][[:xdigit:]]\\)\\)"
                         string index)
       (if (match-beginning 2)
          (setq string (replace-match "\\2" t nil string)
@@ -2086,7 +2086,7 @@ The return value is an alist mapping from types to values."
                     string index))
          (setq index (match-end 0)
                value (epg--decode-quotedstring (match-string 0 string)))
-       (if (eq index (string-match "#\\([0-9A-Fa-f]+\\)" string index))
+       (if (eq index (string-match "#\\([[:xdigit:]]+\\)" string index))
            (setq index (match-end 0)
                  value (epg--decode-hexstring (match-string 1 string)))
          (if (eq index (string-match "\"\\([^\\\"]\\|\\\\.\\)*\""
index 89b598669c92c7525ddea774fcd1f39a039cc796..f9e8c6c58b8c98bf24e5ec885b3165782c43f130 100644 (file)
@@ -1997,7 +1997,7 @@ resulting color name in the echo area."
       (when (and convert-to-RGB
                 (not (string-equal color "")))
        (let ((components (x-color-values color)))
-         (unless (string-match-p "^#\\(?:[a-fA-F0-9][a-fA-F0-9][a-fA-F0-9]\\)+$" color)
+         (unless (string-match-p "^#\\(?:[[:xdigit:]][[:xdigit:]][[:xdigit:]]\\)+$" color)
            (setq color (format "#%04X%04X%04X"
                                (logand 65535 (nth 0 components))
                                (logand 65535 (nth 1 components))
index 601ea00810d26633c7a7609bf3d1319bd393d812..42e1a821b90acdcb5545c8db60feb076ec987a81 100644 (file)
@@ -7423,10 +7423,10 @@ must return `mid', `mail', `invalid' or `ask'."
     (-2.0  . "^[0-9]")
     (-1.0  . "^[0-9][0-9]")
     ;;
-    ;; -3.0 /^[0-9][0-9a-fA-F]{2,2}/;
-    (-3.0  . "^[0-9][0-9a-fA-F][0-9a-fA-F][^0-9a-fA-F]")
-    ;; -5.0 /^[0-9][0-9a-fA-F]{3,3}/;
-    (-5.0  . "^[0-9][0-9a-fA-F][0-9a-fA-F][0-9a-fA-F][^0-9a-fA-F]")
+    ;; -3.0 /^[0-9][[:xdigit:]]{2,2}/;
+    (-3.0  . "^[0-9][[:xdigit:]][[:xdigit:]][^[:xdigit:]]")
+    ;; -5.0 /^[0-9][[:xdigit:]]{3,3}/;
+    (-5.0  . "^[0-9][[:xdigit:]][[:xdigit:]][[:xdigit:]][^[:xdigit:]]")
     ;;
     (-3.0  .  "[0-9][0-9][0-9][0-9][0-9][^0-9].*@") ;; "[0-9]{5,}.*\@"
     (-3.0  .  "[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][^0-9].*@")
index db7489fbf1c41c05aaaad9e71406afb9adef22a0..02a27b367cdff3441ac44e46a1f97ac29ac363b5 100644 (file)
@@ -725,7 +725,7 @@ Otherwise, NAME is treated as user ID, for which no keys are returned if it
 is expired or revoked.
 If optional JUSTONE is not nil, return the first key instead of a list."
   (let* ((keys (epg-list-keys context name))
-        (iskeyid (string-match "\\(0x\\)?\\([0-9a-fA-F]\\{8,\\}\\)" name))
+        (iskeyid (string-match "\\(0x\\)?\\([[:xdigit:]]\\{8,\\}\\)" name))
         (fingerprint (match-string 2 name))
         result)
     (when (and iskeyid (>= (length keys) 2))
index f64007aaf7981d7d201fceb68fa8a5c028b7801f..c3d511bc6e0200e04343bd1d5c14b4d0954182b0 100644 (file)
@@ -297,7 +297,7 @@ included.")
 (defun nneething-decode-file-name (file &optional coding-system)
   "Decode the name of the FILE is encoded in CODING-SYSTEM."
   (let ((pos 0) buf)
-    (while (string-match "%\\([0-9a-fA-F][0-9a-fA-F]\\)" file pos)
+    (while (string-match "%\\([[:xdigit:]][[:xdigit:]]\\)" file pos)
       (setq buf (cons (string (string-to-number (match-string 1 file) 16))
                      (cons (substring file pos (match-beginning 0)) buf))
            pos (match-end 0)))
index c7414a20be8b716c150f2a8276e029bee110200f..dfba025742a058d8fcf58e96687fe79386ea3c71 100644 (file)
@@ -566,7 +566,7 @@ therefore no longer care about) will be invalid at any time.\n
 (defvar hfy-tmpfont-stack nil
   "An alist of derived fonts resulting from overlays.")
 
-(defconst hfy-hex-regex "[0-9A-Fa-f]")
+(defconst hfy-hex-regex "[[:xdigit:]]")
 
 (defconst hfy-triplet-regex
   (concat
index 47b07479c3c35d00234a932fd7b630b320d959cf..1edf80d14c82f29cf9f479efbc84a31908a90ccb 100644 (file)
@@ -3079,7 +3079,7 @@ as names, not numbers."
         (char
           (cond
            ((char-from-name input t))
-           ((string-match-p "\\`[0-9a-fA-F]+\\'" input)
+           ((string-match-p "\\`[[:xdigit:]]+\\'" input)
             (ignore-errors (string-to-number input 16)))
            ((string-match-p "\\`#\\([bBoOxX]\\|[0-9]+[rR]\\)[0-9a-zA-Z]+\\'"
                             input)
index 0a0983c25f82c0c03dc8140c4478890e9030c3a5..6ddb2964e5173e69351a70fe86b50a394084afea 100644 (file)
@@ -223,7 +223,7 @@ These look like:
     (mm-with-unibyte-buffer
       (insert value)
       (goto-char (point-min))
-      (while (re-search-forward "%\\([0-9A-Fa-f][0-9A-Fa-f]\\)" nil t)
+      (while (re-search-forward "%\\([[:xdigit:]][[:xdigit:]]\\)" nil t)
        (insert
         (prog1
             (string-to-number (match-string 1) 16)
index 2d6cf68d8ff5522a56643eded6bc9096fe2b47d2..af0b99c76f42b709ecc44e700c262df7d86acb27 100644 (file)
@@ -235,7 +235,7 @@ Like rgb() or hsl()."
     (cond
      ;; Hexadecimal color: #abc or #aabbcc
      ((string-match
-       "\\(#[0-9a-fA-F]\\{3\\}[0-9a-fA-F]\\{3\\}?\\)"
+       "\\(#[[:xdigit:]]\\{3\\}[[:xdigit:]]\\{3\\}?\\)"
        color)
       (match-string 1 color))
      ;; rgb() or rgba() colors
index 2956efb736e6e592470f7a44cc7cc4b00d4bdea7..c524567a5b2c64267e5eab961cbf736e59244c5e 100644 (file)
   (let (lst head)
     (with-current-buffer (find-file-noselect file)
       (goto-char (point-min))
-      (while (re-search-forward "^ *\\([a-fA-F0-9]\\{2\\}\\)[ \t]+" nil t)
+      (while (re-search-forward "^ *\\([[:xdigit:]]\\{2\\}\\)[ \t]+" nil t)
        (let ((row (match-string 1))
              (eol (line-end-position)))
-         (while (re-search-forward "\\([a-fA-F0-9]\\{2\\}\\)-\\([a-fA-F0-9]\\{2\\}\\)\\|\\([a-fA-F0-9]\\{2\\}\\)" eol t)
+         (while (re-search-forward "\\([[:xdigit:]]\\{2\\}\\)-\\([[:xdigit:]]\\{2\\}\\)\\|\\([[:xdigit:]]\\{2\\}\\)" eol t)
            (setq lst
                  (cons (if (match-beginning 3)
                            (concat "#x" row (match-string 3))
index d36f9d92f26435a97ba2fb6dc877b18c354fe2a4..60c871990e10fef7f49cdf4345e6545c05047e41 100644 (file)
@@ -369,7 +369,7 @@ OVERRIDE is either nil, require or t."
     (and pos
         (rng-c-error "Nul character found (binary file?)")))
   (let ((offset 0))
-    (while (re-search-forward "\\\\x+{\\([0-9a-fA-F]+\\)}"
+    (while (re-search-forward "\\\\x+{\\([[:xdigit:]]+\\)}"
                              (point-max)
                              t)
       (let* ((ch (decode-char 'ucs (string-to-number (match-string 1) 16))))
index 798475bbc3da2a5e679952cd94486f0d86f89291..5a67cc7f145ac7885d1b08dcbd9034fe3b701046 100644 (file)
@@ -68,7 +68,7 @@ Signal an error if URI is not a valid file URL."
 
 ;; pattern is either nil or match or replace
 (defun rng-uri-file-name-1 (uri pattern)
-  (unless (string-match "\\`\\(?:[^%]\\|%[0-9a-fA-F]{2}\\)*\\'" uri)
+  (unless (string-match "\\`\\(?:[^%]\\|%[[:xdigit:]]{2}\\)*\\'" uri)
     (rng-uri-error "Bad escapes in URI `%s'" uri))
   (setq uri (rng-uri-unescape-multibyte uri))
   (let* ((components
@@ -299,7 +299,7 @@ Both FULL and BASE must be absolute URIs."
        (mapconcat 'identity segments "/")))
 
 (defun rng-uri-unescape-multibyte (str)
-  (replace-regexp-in-string "\\(?:%[89a-fA-F][0-9a-fA-F]\\)+"
+  (replace-regexp-in-string "\\(?:%[89a-fA-F][[:xdigit:]]\\)+"
                            'rng-multibyte-percent-decode
                            str))
 
@@ -310,7 +310,7 @@ Both FULL and BASE must be absolute URIs."
                         'utf-8))
 
 (defun rng-uri-unescape-unibyte (str)
-  (replace-regexp-in-string "%[0-7][0-9a-fA-F]"
+  (replace-regexp-in-string "%[0-7][[:xdigit:]]"
                            (lambda (h)
                              (string-to-number (substring h 1) 16))
                            str
@@ -318,7 +318,7 @@ Both FULL and BASE must be absolute URIs."
                            t))
 
 (defun rng-uri-unescape-unibyte-match (str)
-  (replace-regexp-in-string "%[0-7][0-9a-fA-F]\\|[^%]"
+  (replace-regexp-in-string "%[0-7][[:xdigit:]]\\|[^%]"
                            (lambda (match)
                              (if (string= match "*")
                                  "\\([^/]*\\)"
@@ -333,7 +333,7 @@ Both FULL and BASE must be absolute URIs."
 
 (defun rng-uri-unescape-unibyte-replace (str next-match-index)
   (replace-regexp-in-string
-   "%[0-7][0-9a-fA-F]\\|[^%]"
+   "%[0-7][[:xdigit:]]\\|[^%]"
    (lambda (match)
      (if (string= match "*")
         (let ((n next-match-index))
index f308b049f3b4e615cbd02b51025d8e58f8a731d3..582d08e149f21ec5b995aadef4d3bb621e9a2d5c 100644 (file)
@@ -330,7 +330,7 @@ trailing digits.  For example, -0021.0430 would be represented by [-1
        (match-string 1 string)))
 
 (defun rng-xsd-convert-hex-binary (string)
-  (and (string-match "\\`[ \r\n\t]*\\(\\(?:[0-9A-Fa-f][0-9A-Fa-f]\\)*\\)[ \r\n\t]*\\'"
+  (and (string-match "\\`[ \r\n\t]*\\(\\(?:[[:xdigit:]][[:xdigit:]]\\)*\\)[ \r\n\t]*\\'"
                     string)
        (downcase (match-string 1 string))))
 
@@ -360,7 +360,7 @@ trailing digits.  For example, -0021.0430 would be represented by [-1
       n)))
 
 (defun rng-xsd-convert-any-uri (string)
-  (and (string-match "\\`\\(?:[^%]\\|%[0-9a-fA-F][0-9a-fA-F]\\)*\\'" string)
+  (and (string-match "\\`\\(?:[^%]\\|%[[:xdigit:]][[:xdigit:]]\\)*\\'" string)
        (string-match "\\`[^#]*\\(?:#[^#]*\\)?\\'" string)
        (string-match "\\`\\(?:[a-zA-Z][-+.A-Za-z0-9]*:.+\\|[^:]*\\(?:[#/?].*\\)?\\)\\'" string)
        string))
index afa33e064f3364caa99cc27564847f4350048692..3cab5ed9b7bb1bbea80a17dd65811e6684cbfcc6 100644 (file)
@@ -413,7 +413,7 @@ and VALUE-END, otherwise a STRING giving the value."
                   (xmltok-g decimal-ref-close ";") opt))
         (hex-ref
          (xmltok+ "x" open
-                  (xmltok-g hex "[0-9a-fA-F]" +)
+                  (xmltok-g hex "[[:xdigit:]]" +)
                   (xmltok-g hex-ref-close ";") opt
                   close opt))
         (char-ref
index 7ae169c19c61e75f8096bfedafa2115e0671e204..c002e6fd9fb52cb6471c35053ccadadc093b02bf 100644 (file)
@@ -702,7 +702,7 @@ Code is inserted into the current buffer."
   (with-current-buffer (find-file-noselect file)
     (goto-char (point-min))
     (mapc (lambda (x) (put x 'xsdre-ranges nil)) xsdre-gen-categories)
-    (while (re-search-forward "^\\([0-9A-Fa-f]*\\);[^;]*;\\([A-Z][a-z]\\);"
+    (while (re-search-forward "^\\([[:xdigit:]]*\\);[^;]*;\\([A-Z][a-z]\\);"
                              nil
                              t)
       (let* ((sym (intern (match-string-no-properties 2)))
index 8b4e895388964010a9e0f5326c16ff486e85afc6..a1552606eb5b099376c49164923b4681ebe27058 100644 (file)
@@ -472,7 +472,7 @@ agenda view showing the flagged items."
                     (concat (shell-quote-argument org-mobile-checksum-binary)
                             " "
                             (shell-quote-argument (expand-file-name file)))))
-       (when (string-match "[a-fA-F0-9]\\{30,40\\}" check)
+       (when (string-match "[[:xdigit:]]\\{30,40\\}" check)
          (push (cons link-name (match-string 0 check))
                org-mobile-checksum-files))))
 
@@ -761,7 +761,7 @@ If nothing new has been added, return nil."
         (buffer (find-file-noselect file)))
     (when buffer
       (with-current-buffer buffer
-       (when (re-search-forward (concat "\\([0-9a-fA-F]\\{30,\\}\\).*?"
+       (when (re-search-forward (concat "\\([[:xdigit:]]\\{30,\\}\\).*?"
                                         (regexp-quote org-mobile-capture-file)
                                         "[ \t]*$") nil t)
          (goto-char (match-beginning 1))
index 147527da1d39be3bf52c8df3e1671740ac00b4ef..513a534d9b580758775e261911ebe12b310e7b4d 100644 (file)
@@ -155,7 +155,7 @@ table, obtained by prompting the user."
   :type 'string)
 
 (defcustom org-table-number-regexp
-  "^\\([<>]?[-+^.0-9]*[0-9][-+^.0-9eEdDx()%:]*\\|[<>]?[-+]?0[xX][0-9a-fA-F.]+\\|[<>]?[-+]?[0-9]+#[0-9a-zA-Z.]+\\|nan\\|[-+u]?inf\\)$"
+  "^\\([<>]?[-+^.0-9]*[0-9][-+^.0-9eEdDx()%:]*\\|[<>]?[-+]?0[xX][[:xdigit:].]+\\|[<>]?[-+]?[0-9]+#[0-9a-zA-Z.]+\\|nan\\|[-+u]?inf\\)$"
   "Regular expression for recognizing numbers in table columns.
 If a table column contains mostly numbers, it will be aligned to the
 right.  If not, it will be aligned to the left.
@@ -180,9 +180,9 @@ Other options offered by the customize interface are more restrictive."
          (const :tag "Exponential, Floating point, Integer"
                 "^[-+]?[0-9.]+\\([eEdD][-+0-9]+\\)?$")
          (const :tag "Very General Number-Like, including hex and Calc radix"
-                "^\\([<>]?[-+^.0-9]*[0-9][-+^.0-9eEdDx()%]*\\|[<>]?[-+]?0[xX][0-9a-fA-F.]+\\|[<>]?[-+]?[0-9]+#[0-9a-zA-Z.]+\\|nan\\|[-+u]?inf\\)$")
+                "^\\([<>]?[-+^.0-9]*[0-9][-+^.0-9eEdDx()%]*\\|[<>]?[-+]?0[xX][[:xdigit:].]+\\|[<>]?[-+]?[0-9]+#[0-9a-zA-Z.]+\\|nan\\|[-+u]?inf\\)$")
          (const :tag "Very General Number-Like, including hex and Calc radix, allows comma as decimal mark"
-                "^\\([<>]?[-+^.,0-9]*[0-9][-+^.0-9eEdDx()%]*\\|[<>]?[-+]?0[xX][0-9a-fA-F.]+\\|[<>]?[-+]?[0-9]+#[0-9a-zA-Z.]+\\|nan\\|[-+u]?inf\\)$")
+                "^\\([<>]?[-+^.,0-9]*[0-9][-+^.0-9eEdDx()%]*\\|[<>]?[-+]?0[xX][[:xdigit:].]+\\|[<>]?[-+]?[0-9]+#[0-9a-zA-Z.]+\\|nan\\|[-+u]?inf\\)$")
          (string :tag "Regexp:")))
 
 (defcustom org-table-number-fraction 0.5
index 77c1e5e2d87f375cde49c6bb5774b09bf49f8ebe..404e704373ed2ff4894d875f6a79369edebbe4b0 100644 (file)
@@ -909,7 +909,7 @@ the 4 file locations can be clicked on and jumped to."
                               change))
            (replace-match "'A'"))
          (goto-char from)
-         (while (re-search-forward "\\(#[0-9a-fA-F]*#\\)" to t)
+         (while (re-search-forward "\\(#[[:xdigit:]]*#\\)" to t)
            (setq change (cons (list (match-beginning 1)
                                     (length (match-string 1))
                                     (match-string 1))
@@ -1013,7 +1013,7 @@ If PARSE-RESULT is non-nil, use it instead of calling `parse-partial-sexp'."
 
 (defsubst ada-in-numeric-literal-p ()
   "Return t if point is after a prefix of a numeric literal."
-  (looking-back "\\([0-9]+#[0-9a-fA-F_]+\\)" (line-beginning-position)))
+  (looking-back "\\([0-9]+#[[:xdigit:]_]+\\)" (line-beginning-position)))
 
 ;;------------------------------------------------------------------
 ;; Contextual menus
@@ -5213,7 +5213,7 @@ Return nil if no body was found."
      '("<<\\(\\sw+\\)>>" 1 font-lock-constant-face)
 
      ;; Highlight based-numbers (R. Reagan <robin-reply@reagans.org>)
-     (list "\\([0-9]+#[0-9a-fA-F_]+#\\)" '(1 font-lock-constant-face t))
+     (list "\\([0-9]+#[[:xdigit:]_]+#\\)" '(1 font-lock-constant-face t))
 
      ;; Ada unnamed numerical constants
      (list "\\W\\([-+]?[0-9._]+\\)\\>" '(1 font-lock-constant-face))
index 568fceece24e7cf6960bb0a11a6143819f213068..b45c2e5fd381af678e558473d0534cf21bd8f0a8 100644 (file)
@@ -1513,7 +1513,7 @@ Note that the style variables are always made local to the buffer."
 (defconst c-maybe-quoted-number-head
   (concat
    "\\(0\\("
-       "\\([Xx]\\([0-9a-fA-F]\\('[0-9a-fA-F]\\|[0-9a-fA-F]\\)*'?\\)?\\)"
+       "\\([Xx]\\([[:xdigit:]]\\('[[:xdigit:]]\\|[[:xdigit:]]\\)*'?\\)?\\)"
        "\\|"
        "\\([Bb]\\([01]\\('[01]\\|[01]\\)*'?\\)?\\)"
        "\\|"
@@ -1533,7 +1533,7 @@ Note that the style variables are always made local to the buffer."
     (save-excursion
       (let ((here (point))
            found)
-       (skip-chars-backward "0-9a-fA-F'")
+       (skip-chars-backward "[:xdigit:]'")
        (if (and (memq (char-before) '(?x ?X))
                 (eq (char-before (1- (point))) ?0))
            (backward-char 2))
@@ -1547,7 +1547,7 @@ Note that the style variables are always made local to the buffer."
 (defconst c-maybe-quoted-number-tail
   (concat
    "\\("
-       "\\([xX']?[0-9a-fA-F]\\('[0-9a-fA-F]\\|[0-9a-fA-F]\\)*\\)"
+       "\\([xX']?[[:xdigit:]]\\('[[:xdigit:]]\\|[[:xdigit:]]\\)*\\)"
    "\\|"
        "\\([bB']?[01]\\('[01]\\|[01]\\)*\\)"
    "\\|"
@@ -1567,7 +1567,7 @@ Note that this is a strict tail, so won't match, e.g. \"0x....\".")
 (defconst c-maybe-quoted-number
   (concat
    "\\(0\\("
-       "\\([Xx][0-9a-fA-F]\\('[0-9a-fA-F]\\|[0-9a-fA-F]\\)*\\)"
+       "\\([Xx][[:xdigit:]]\\('[[:xdigit:]]\\|[[:xdigit:]]\\)*\\)"
        "\\|"
        "\\([Bb][01]\\('[01]\\|[01]\\)*\\)"
        "\\|"
@@ -1585,9 +1585,9 @@ Note that this is a strict tail, so won't match, e.g. \"0x....\".")
   (when c-has-quoted-numbers
     (save-excursion
       (let ((here (point))
-           (bound (progn (skip-chars-forward "0-9a-fA-F'") (point))))
+           (bound (progn (skip-chars-forward "[:xdigit:]'") (point))))
        (goto-char here)
-       (when (< (skip-chars-backward "0-9a-fA-F'") 0)
+       (when (< (skip-chars-backward "[:xdigit:]'") 0)
          (if (and (memq (char-before) '(?x ?X))
                   (eq (char-before (1- (point))) ?0))
              (backward-char 2))
@@ -1628,7 +1628,7 @@ Note that this is a strict tail, so won't match, e.g. \"0x....\".")
        (if (>= (point) c-new-BEG)
            (setq c-new-BEG (match-beginning 0))))
        ((looking-at
-        "\\([^'\\]\\|\\\\\\([0-7]\\{1,3\\}\\|[xuU][0-9a-fA-F]+\\|.\\)\\)'")
+        "\\([^'\\]\\|\\\\\\([0-7]\\{1,3\\}\\|[xuU][[:xdigit:]]+\\|.\\)\\)'")
        (goto-char (match-end 0))
        (if (> (match-end 0) c-new-BEG)
            (setq c-new-BEG (1- (match-beginning 0)))))
@@ -1657,7 +1657,7 @@ Note that this is a strict tail, so won't match, e.g. \"0x....\".")
        (if (> (match-end 0) c-new-END)
            (setq c-new-END (match-end 0))))
        ((looking-at
-        "\\([^'\\]\\|\\\\\\([0-7]\\{1,3\\}\\|[xuU][0-9a-fA-F]+\\|.\\)\\)'")
+        "\\([^'\\]\\|\\\\\\([0-7]\\{1,3\\}\\|[xuU][[:xdigit:]]+\\|.\\)\\)'")
        (goto-char (match-end 0))
        (if (> (match-end 0) c-new-END)
            (setq c-new-END (match-end 0))))
@@ -1677,8 +1677,8 @@ Note that this is a strict tail, so won't match, e.g. \"0x....\".")
      ((c-quoted-number-tail-after-point)
       (setq c-new-END (match-end 0)))
      ((looking-at
-       "\\(\\\\\\([0-7]\\{1,3\\}\\|[xuU][0-9a-fA-F]+\\|.\\)\\|.\\)?\
-\\('\\([^'\\]\\|\\\\\\([0-7]\\{1,3\\}\\|[xuU][0-9a-fA-F]+\\|.\\)\\)\\)*'")
+       "\\(\\\\\\([0-7]\\{1,3\\}\\|[xuU][[:xdigit:]]+\\|.\\)\\|.\\)?\
+\\('\\([^'\\]\\|\\\\\\([0-7]\\{1,3\\}\\|[xuU][[:xdigit:]]+\\|.\\)\\)\\)*'")
       (setq c-new-END (match-end 0))))
 
     ;; Remove the '(1) syntax-table property from any "'"s within (c-new-BEG
@@ -1730,7 +1730,7 @@ Note that this is a strict tail, so won't match, e.g. \"0x....\".")
                                              'c-digit-separator t ?')
               (goto-char num-end))
              ((looking-at
-               "\\([^\\']\\|\\\\\\([0-7]\\{1,3\\}\\|[xuU][0-9a-fA-F]+\\|.\\)\
+               "\\([^\\']\\|\\\\\\([0-7]\\{1,3\\}\\|[xuU][[:xdigit:]]+\\|.\\)\
 \\)'") ; balanced quoted expression.
               (goto-char (match-end 0)))
              ((looking-at "\\\\'")     ; Anomalous construct.
index 254269ddf1ab89f5796f156802d63cfd0303bff0..1aa79817916c370b83f60b7a6fc0663eaa80ff75 100644 (file)
@@ -3463,18 +3463,18 @@ Should be called with the point before leading colon of an attribute."
 (defsubst cperl-highlight-charclass (endbracket dashface bsface onec-space)
   (let ((l '(1 5 7)) ll lle lll
        ;; 2 groups, the first takes the whole match (include \[trnfabe])
-       (singleChar (concat "\\(" "[^\\]" "\\|" "\\\\[^cdg-mo-qsu-zA-Z0-9_]" "\\|" "\\\\c." "\\|" "\\\\x" "\\([0-9a-fA-F][0-9a-fA-F]?\\|\\={[0-9a-fA-F]+}\\)" "\\|" "\\\\0?[0-7][0-7]?[0-7]?" "\\|" "\\\\N{[^{}]*}" "\\)")))
+       (singleChar (concat "\\(" "[^\\]" "\\|" "\\\\[^cdg-mo-qsu-zA-Z0-9_]" "\\|" "\\\\c." "\\|" "\\\\x" "\\([[:xdigit:]][[:xdigit:]]?\\|\\={[[:xdigit:]]+}\\)" "\\|" "\\\\0?[0-7][0-7]?[0-7]?" "\\|" "\\\\N{[^{}]*}" "\\)")))
     (while                             ; look for unescaped - between non-classes
        (re-search-forward
         ;; On 19.33, certain simplifications lead
         ;; to bugs (as in  [^a-z] \\| [trnfabe]  )
         (concat                        ; 1: SingleChar (include \[trnfabe])
          singleChar
-         ;;"\\(" "[^\\]" "\\|" "\\\\[^cdg-mo-qsu-zA-Z0-9_]" "\\|" "\\\\c." "\\|" "\\\\x" "\\([0-9a-fA-F][0-9a-fA-F]?\\|\\={[0-9a-fA-F]+}\\)" "\\|" "\\\\0?[0-7][0-7]?[0-7]?" "\\|" "\\\\N{[^{}]*}" "\\)"
+         ;;"\\(" "[^\\]" "\\|" "\\\\[^cdg-mo-qsu-zA-Z0-9_]" "\\|" "\\\\c." "\\|" "\\\\x" "\\([[:xdigit:]][[:xdigit:]]?\\|\\={[[:xdigit:]]+}\\)" "\\|" "\\\\0?[0-7][0-7]?[0-7]?" "\\|" "\\\\N{[^{}]*}" "\\)"
          "\\("                         ; 3: DASH SingleChar (match optionally)
            "\\(-\\)"                   ; 4: DASH
            singleChar                  ; 5: SingleChar
-           ;;"\\(" "[^\\]" "\\|" "\\\\[^cdg-mo-qsu-zA-Z0-9_]" "\\|" "\\\\c." "\\|" "\\\\x" "\\([0-9a-fA-F][0-9a-fA-F]?\\|\\={[0-9a-fA-F]+}\\)" "\\|" "\\\\0?[0-7][0-7]?[0-7]?" "\\|" "\\\\N{[^{}]*}" "\\)"
+           ;;"\\(" "[^\\]" "\\|" "\\\\[^cdg-mo-qsu-zA-Z0-9_]" "\\|" "\\\\c." "\\|" "\\\\x" "\\([[:xdigit:]][[:xdigit:]]?\\|\\={[[:xdigit:]]+}\\)" "\\|" "\\\\0?[0-7][0-7]?[0-7]?" "\\|" "\\\\N{[^{}]*}" "\\)"
          "\\)?"
          "\\|"
          "\\("                         ; 7: other escapes
@@ -4368,7 +4368,7 @@ the sections using `cperl-pod-head-face', `cperl-pod-face',
                                            "\\=[0123456789]*" (1- e) 'to-end))
                                      (and (eq qtag ?x)
                                           (re-search-forward
-                                           "\\=[0-9a-fA-F][0-9a-fA-F]?\\|\\={[0-9a-fA-F]+}"
+                                           "\\=[[:xdigit:]][[:xdigit:]]?\\|\\={[[:xdigit:]]+}"
                                            (1- e) 'to-end))
                                      (and (memq qtag (append "pPN" nil))
                                           (re-search-forward "\\={[^{}]+}\\|."
index 53d37b689f0f74b2e2b7c72ddde1d4582df4d11d..b00308591f84c9ec40289813d7d522da0bf98aec 100644 (file)
@@ -640,7 +640,7 @@ See documentation for variable `ebnf-abn-lex'."
      (let* ((char  (following-char))
            (chars (cond ((or (= char ?B) (= char ?b)) "01")
                         ((or (= char ?D) (= char ?d)) "0-9")
-                        ((or (= char ?X) (= char ?x)) "0-9A-Fa-f")
+                        ((or (= char ?X) (= char ?x)) "[:xdigit:]")
                         (t (error "Invalid terminal value")))))
        (forward-char)
        (or (> (skip-chars-forward chars ebnf-limit) 0)
index 94d964326149011a9dd9bb94c01d89c9a6c0a24c..74ff1f47d16b260a79f7c37380ef9e615bb243f2 100644 (file)
 ;; /* Character Reference */
 ;;
 ;; CharRef ::= '&#' [0-9]+ ';'
-;;           | '&#x' [0-9a-fA-F]+ ';'
+;;           | '&#x' [[:xdigit:]]+ ';'
 ;;           [WFC: Legal Character]
 ;;
 ;;
 ;;; EntityRef ::= '&' Name ';'
 ;;;
 ;;; CharRef ::= '&#' [0-9]+ ';'
-;;;           | '&#x' [0-9a-fA-F]+ ';'
+;;;           | '&#x' [[:xdigit:]]+ ';'
 
-;;; "^\\(&\\([A-Za-z_:][-A-Za-z0-9._:]*\\|#\\(x[0-9a-fA-F]+\\|[0-9]+\\)\\);\\|[^<&]\\)*$"
+;;; "^\\(&\\([A-Za-z_:][-A-Za-z0-9._:]*\\|#\\(x[[:xdigit:]]+\\|[0-9]+\\)\\);\\|[^<&]\\)*$"
 
 
 (defun ebnf-dtd-attlistdecl ()
             (setq token (ebnf-dtd-lex)))
        (or (and (eq token 'string)
                 (string-match
-                 "^\\(&\\([A-Za-z_:][-A-Za-z0-9._:]*\\|#\\(x[0-9a-fA-F]+\\|[0-9]+\\)\\);\\|[^<&]\\)*$"
+                 "^\\(&\\([A-Za-z_:][-A-Za-z0-9._:]*\\|#\\(x[[:xdigit:]]+\\|[0-9]+\\)\\);\\|[^<&]\\)*$"
                  ebnf-dtd-lex))
            (error "Invalid default value in ATTLIST declaration"))))
     (or (eq token 'end-decl)
 ;;; EntityRef ::= '&' Name ';'
 ;;;
 ;;; CharRef ::= '&#' [0-9]+ ';'
-;;;           | '&#x' [0-9a-fA-F]+ ';'
+;;;           | '&#x' [[:xdigit:]]+ ';'
 
-;;; "^\\(%[A-Za-z_:][-A-Za-z0-9._:]*;\\|&\\([A-Za-z_:][-A-Za-z0-9._:]*\\|#\\(x[0-9a-fA-F]+\\|[0-9]+\\)\\);\\|[^%&]\\)*$"
+;;; "^\\(%[A-Za-z_:][-A-Za-z0-9._:]*;\\|&\\([A-Za-z_:][-A-Za-z0-9._:]*\\|#\\(x[[:xdigit:]]+\\|[0-9]+\\)\\);\\|[^%&]\\)*$"
 
 
 (defun ebnf-dtd-entitydecl ()
     (setq token (ebnf-dtd-lex))
     (if (eq token 'string)
        (if (string-match
-            "^\\(%[A-Za-z_:][-A-Za-z0-9._:]*;\\|&\\([A-Za-z_:][-A-Za-z0-9._:]*\\|#\\(x[0-9a-fA-F]+\\|[0-9]+\\)\\);\\|[^%&]\\)*$"
+            "^\\(%[A-Za-z_:][-A-Za-z0-9._:]*;\\|&\\([A-Za-z_:][-A-Za-z0-9._:]*\\|#\\(x[[:xdigit:]]+\\|[0-9]+\\)\\);\\|[^%&]\\)*$"
             ebnf-dtd-lex)
            (setq token (ebnf-dtd-lex))
          (error "Invalid ENTITY definition"))
@@ -1242,7 +1242,7 @@ See documentation for variable `ebnf-dtd-lex'."
          (setq ebnf-dtd-lex (if (/= (following-char) ?x)
                                 (ebnf-dtd-char-ref "&#" "0-9")
                               (forward-char)
-                              (ebnf-dtd-char-ref "&#x" "0-9a-fA-F")))
+                              (ebnf-dtd-char-ref "&#x" "[:xdigit:]")))
          'char-ref))
        ;; miscellaneous: (, ), [, ], =, |, *, +, >, `,'
        (t
index 25500f16186875d1e5421263b48a0e04ee18b263..dc1a60f3741e32e4b2fbe41594f364cf13a200d1 100644 (file)
@@ -658,7 +658,7 @@ See documentation for variable `ebnf-ebx-lex'."
       (or no-error
          (error "Invalid hexadecimal character"))
     (forward-char)
-    (or (> (skip-chars-forward "0-9A-Fa-f" ebnf-limit) 0)
+    (or (> (skip-chars-forward "[:xdigit:]" ebnf-limit) 0)
        (error "Invalid hexadecimal character"))))
 
 \f
index 32b0b7551f915ac358d106f978584a82a427b533..1b06077005c69a6e1b91068081a4c294a20785ec 100644 (file)
@@ -540,7 +540,7 @@ that form should be displayed.")
 
 (defconst hif-token-regexp
   (concat (regexp-opt (mapcar 'car hif-token-alist))
-          "\\|0x[0-9a-fA-F]+\\.?[0-9a-fA-F]*"
+          "\\|0x[[:xdigit:]]+\\.?[[:xdigit:]]*"
           "\\|[0-9]+\\.?[0-9]*"  ;; decimal/octal
           "\\|\\w+"))
 
@@ -595,7 +595,7 @@ that form should be displayed.")
                    ;; 1. postfix 'l', 'll', 'ul' and 'ull'
                    ;; 2. floating number formats (like 1.23e4)
                    ;; 3. 098 is interpreted as octal conversion error
-                   (if (string-match "0x\\([0-9a-fA-F]+\\.?[0-9a-fA-F]*\\)"
+                   (if (string-match "0x\\([[:xdigit:]]+\\.?[[:xdigit:]]*\\)"
                                      token)
                        (hif-string-to-number (match-string 1 token) 16)) ;; hex
                    (if (string-match "\\`0[0-9]+\\(\\.[0-9]+\\)?\\'" token)
index 296a7ac3c95f872385d960c52e9e2111c6b45f66..780eff2d8a0e9fedf4ffcf23c99607f1672c4765 100644 (file)
@@ -1071,7 +1071,7 @@ VERSION is of the format (Major . Minor)"
      ;; Supposedly, ISO-Prolog wants \NNN\ for octal and \xNNN\ for hexadecimal
      ;; escape sequences in atoms, so be careful not to let the terminating \
      ;; escape a subsequent quote.
-     ("\\\\[x0-7][0-9a-fA-F]*\\(\\\\\\)" (1 "_"))
+     ("\\\\[x0-7][[:xdigit:]]*\\(\\\\\\)" (1 "_"))
      )))
 
 (defun prolog-mode-variables ()
index f34b21e4cf4cfbc6e87c7d58b8849febb83297e7..21d3db91ad34bff04fc9a31d1fdf92006374808e 100644 (file)
@@ -635,7 +635,7 @@ Adapted from `font-lock-match-c-style-declaration-item-and-skip-to-next'."
    (list (concat "^\\s-*" vera-rvm-types-regexp "\\s-*\\(\\[[^]]+\\]\\s-+\\)?")
         '(vera-font-lock-match-item nil nil (1 font-lock-variable-name-face)))
    ;; highlight numbers
-   '("\\([0-9]*'[bdoh][0-9a-fA-FxXzZ_]+\\)" 1 vera-font-lock-number)
+   '("\\([0-9]*'[bdoh][[:xdigit:]xXzZ_]+\\)" 1 vera-font-lock-number)
    ;; highlight filenames in #include directives
    '("^#\\s-*include\\s-*\\(<[^>\"\n]*>?\\)"
      1 font-lock-string-face)
index 8ddd262af3e545a35194f8f10beaf3766df41c12..4295f2e5a0d026da08b2cc7e7ed6b30366bbf7ec 100644 (file)
@@ -2762,7 +2762,7 @@ find the errors."
    "\\s-*\\(\\<\\(reg\\|wire\\)\\>\\s-*\\)?\\(\\<\\(un\\)?signed\\>\\s-*\\)?\\(" verilog-range-re "\\)?"))
 (defconst verilog-macroexp-re "`\\sw+")
 
-(defconst verilog-delay-re "#\\s-*\\(\\([0-9_]+\\('s?[hdxbo][0-9a-fA-F_xz]+\\)?\\)\\|\\(([^()]*)\\)\\|\\(\\sw+\\)\\)")
+(defconst verilog-delay-re "#\\s-*\\(\\([0-9_]+\\('s?[hdxbo][[:xdigit:]_xz]+\\)?\\)\\|\\(([^()]*)\\)\\|\\(\\sw+\\)\\)")
 (defconst verilog-declaration-re-2-no-macro
   (concat "\\s-*" verilog-declaration-re
           "\\s-*\\(\\(" verilog-optional-signed-range-re "\\)\\|\\(" verilog-delay-re "\\)"
@@ -3292,7 +3292,7 @@ See also `verilog-font-lock-extra-types'.")
                                                       'font-lock-preprocessor-face
                                                     'font-lock-type-face))
                 ;; Fontify delays/numbers
-                '("\\(@\\)\\|\\([ \t\n\f\r]#\\s-*\\(\\([0-9_.]+\\('s?[hdxbo][0-9a-fA-F_xz]*\\)?\\)\\|\\(([^()]+)\\|\\sw+\\)\\)\\)"
+                '("\\(@\\)\\|\\([ \t\n\f\r]#\\s-*\\(\\([0-9_.]+\\('s?[hdxbo][[:xdigit:]_xz]*\\)?\\)\\|\\(([^()]+)\\|\\sw+\\)\\)\\)"
                   0 font-lock-type-face append)
      ;; Fontify property/sequence cycle delays - these start with '##'
      '("\\(##\\(\\sw+\\|\\[[^]]+\\]\\)\\)"
@@ -9182,7 +9182,7 @@ TEMP-NEXT is true to ignore next token, fake from inside case statement."
              (setq end-else-check t))
            (forward-char 1))
           ((equal keywd "'")
-           (cond ((looking-at "'[sS]?[hdxboHDXBO]?[ \t]*[0-9a-fA-F_xzXZ?]+")
+           (cond ((looking-at "'[sS]?[hdxboHDXBO]?[ \t]*[[:xdigit:]_xzXZ?]+")
                    (goto-char (match-end 0)))
                   ((looking-at "'{")
                    (forward-char 2)
@@ -9872,7 +9872,7 @@ Allows version control to check out the file if need be."
   "Return true if SYMBOL is number-like."
   (or (string-match "^[0-9 \t:]+$" symbol)
       (string-match "^[---]*[0-9]+$" symbol)
-      (string-match "^[0-9 \t]+'s?[hdxbo][0-9a-fA-F_xz? \t]*$" symbol)))
+      (string-match "^[0-9 \t]+'s?[hdxbo][[:xdigit:]_xz? \t]*$" symbol)))
 
 (defun verilog-symbol-detick (symbol wing-it)
   "Return an expanded SYMBOL name without any defines.
index 5d5d787945dc7f07eb5434610bd30c8b55b5ef74..b0653bce81ce35eedd4935b2ecda2598efc0802f 100644 (file)
@@ -873,7 +873,7 @@ cannot be completed sensibly: `custom-ident',
    (css--uri-re (1 "|") (2 "|"))))
 
 (defconst css-escapes-re
-  "\\\\\\(?:[^\000-\037\177]\\|[0-9a-fA-F]+[ \n\t\r\f]?\\)")
+  "\\\\\\(?:[^\000-\037\177]\\|[[:xdigit:]]+[ \n\t\r\f]?\\)")
 (defconst css-nmchar-re (concat "\\(?:[-[:alnum:]]\\|" css-escapes-re "\\)"))
 (defconst css-nmstart-re (concat "\\(?:[[:alpha:]]\\|" css-escapes-re "\\)"))
 (defconst css-ident-re ;; (concat css-nmstart-re css-nmchar-re "*")
@@ -1079,10 +1079,10 @@ This recognizes CSS-color-4 extensions."
    (regexp-opt (mapcar #'car css--color-map) 'symbols)
    "\\|"
    ;; Short hex.  css-color-4 adds alpha.
-   "\\(#[0-9a-fA-F]\\{3,4\\}\\b\\)"
+   "\\(#[[:xdigit:]]\\{3,4\\}\\b\\)"
    "\\|"
    ;; Long hex.  css-color-4 adds alpha.
-   "\\(#\\(?:[0-9a-fA-F][0-9a-fA-F]\\)\\{3,4\\}\\b\\)"
+   "\\(#\\(?:[[:xdigit:]][[:xdigit:]]\\)\\{3,4\\}\\b\\)"
    "\\|"
    ;; RGB.
    "\\(\\_<rgba?(\\)"
index aa00024a6d9fa9d1ba35bb0843a22282f95a9c38..d8210037c6d2e967b7897731280d26e28967466f 100644 (file)
@@ -1302,7 +1302,7 @@ With prefix argument UNQUOTEP, unquote the region.  All numeric entities,
     (if unquotep
        ;; FIXME: We should unquote other named character references as well.
        (while (re-search-forward
-               "\\(&\\(amp\\|quot\\|lt\\|gt\\|#\\([0-9]+\\|[xX][0-9a-fA-F]+\\)\\)\\)\\([][<>&;\n\t \"%!'(),/=?]\\|$\\)"
+               "\\(&\\(amp\\|quot\\|lt\\|gt\\|#\\([0-9]+\\|[xX][[:xdigit:]]+\\)\\)\\)\\([][<>&;\n\t \"%!'(),/=?]\\|$\\)"
                nil t)
           (replace-match
            (string
index d13d8c31e807ac73976d748686e61fc18a3450a5..b9e2e50d1f7587238301ccc69787f29e42e765e9 100644 (file)
@@ -120,7 +120,7 @@ or if we could not determine the revision.")
               (with-demoted-errors "Error running git rev-parse: %S"
                 (call-process "git" nil '(t nil) nil "rev-parse" "HEAD")))
           (progn (goto-char (point-min))
-                 (looking-at "[0-9a-fA-F]\\{40\\}"))
+                 (looking-at "[[:xdigit:]]\\{40\\}"))
           (match-string 0)))))
 
 (defun emacs-repository-get-version (&optional dir external)
index 09ec72f792f3bea9db8f30f5818757284fa8c4ad..833eb8aced2e222d203df71b64cb4f5ada5db64b 100644 (file)
@@ -194,13 +194,13 @@ See also `xml-get-attribute-or-nil'."
 ;; [8] Nmtokens ::= Nmtoken (#x20 Nmtoken)*
 (defconst xml-nmtokens-re (concat xml-nmtoken-re "\\(?: " xml-name-re "\\)*"))
 
-;; [66] CharRef ::= '&#' [0-9]+ ';' | '&#x' [0-9a-fA-F]+ ';'
-(defconst xml-char-ref-re  "\\(?:&#[0-9]+;\\|&#x[0-9a-fA-F]+;\\)")
+;; [66] CharRef ::= '&#' [0-9]+ ';' | '&#x' [[:xdigit:]]+ ';'
+(defconst xml-char-ref-re  "\\(?:&#[0-9]+;\\|&#x[[:xdigit:]]+;\\)")
 
 ;; [68] EntityRef   ::= '&' Name ';'
 (defconst xml-entity-ref (concat "&" xml-name-re ";"))
 
-(defconst xml-entity-or-char-ref-re (concat "&\\(?:#\\(x\\)?\\([0-9a-fA-F]+\\)\\|\\("
+(defconst xml-entity-or-char-ref-re (concat "&\\(?:#\\(x\\)?\\([[:xdigit:]]+\\)\\|\\("
                                            xml-name-re "\\)\\);"))
 
 ;; [69] PEReference ::= '%' Name ';'
@@ -889,7 +889,7 @@ This follows the rule [28] in the XML specifications."
 The replacement text is obtained by replacing character
 references and parameter-entity references."
   (let ((ref-re (eval-when-compile
-                 (concat "\\(?:&#\\([0-9]+\\)\\|&#x\\([0-9a-fA-F]+\\)\\|%\\("
+                 (concat "\\(?:&#\\([0-9]+\\)\\|&#x\\([[:xdigit:]]+\\)\\|%\\("
                          xml-name-re "\\)\\);")))
        children)
     (while (string-match ref-re string)
index 5349de055ed394befcd15372d8ec4a40dae0d47d..96a604f9824d5fd020a78db8fb975cc7923a29d7 100644 (file)
@@ -60,7 +60,7 @@
     (should (eq 0
                 (string-match
                  (concat "#<module function "
-                         "\\(at \\(0x\\)?[0-9a-fA-F]+\\( from .*\\)?"
+                         "\\(at \\(0x\\)?[[:xdigit:]]+\\( from .*\\)?"
                          "\\|Fmod_test_sum from .*\\)>")
                  (prin1-to-string (nth 1 descr)))))
     (should (= (nth 2 descr) 3)))