# 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:
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;
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;
@skipshas = ();
next;
}
- if ($found && $_ =~ /^([0-9a-fA-F]{7,}) [^ ]/)
+ if ($found && $_ =~ /^([[:xdigit:]]{7,}) [^ ]/)
{
push ( @skipshas, $1 );
}
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]+\\)?\"?\\)?"
;; 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)))
(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
"\\|"
"\\<[0-9]+[eE][-+]?[0-9]+[fFdD]?\\>"
"\\|"
- "\\<0[xX][0-9a-fA-F]+[lL]?\\>"
+ "\\<0[xX][[:xdigit:]]+[lL]?\\>"
"\\|"
"\\<[0-9]+[lLfFdD]?\\>"
"\\)"
[1-9][0-9]*
;
HEX_LITERAL:
- 0[xX][0-9a-fA-F]+
+ 0[xX][[:xdigit:]]+
;
OCTAL_LITERAL:
0[0-7]*
"\\|"
"\\<[0-9]+[eE][-+]?[0-9]+[fFdD]?\\>"
"\\|"
- "\\<0[xX][0-9a-fA-F]+[lL]?\\>"
+ "\\<0[xX][[:xdigit:]]+[lL]?\\>"
"\\|"
"\\<[0-9]+[lLfFdD]?\\>"
"\\)"
[1-9][0-9]*
;
HEX_LITERAL:
- 0[xX][0-9a-fA-F]+
+ 0[xX][[:xdigit:]]+
;
OCTAL_LITERAL:
0[0-7]*
(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))
(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))))
(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
(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)
(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
(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)
(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)
(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)
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 "\"\\([^\\\"]\\|\\\\.\\)*\""
(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))
(-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].*@")
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))
(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)))
(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
(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)
(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)
(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
(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))
(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))))
;; 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
(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))
'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
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 "*")
"\\([^/]*\\)"
(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))
(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))))
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))
(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
(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)))
(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))))
(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))
: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.
(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
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))
(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
'("<<\\(\\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))
(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]\\)*'?\\)?\\)"
"\\|"
(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))
(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]\\)*\\)"
"\\|"
(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]\\)*\\)"
"\\|"
(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))
(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)))))
(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))))
((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
'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.
(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
"\\=[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 "\\={[^{}]+}\\|."
(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)
;; /* 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"))
(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
(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
(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+"))
;; 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)
;; 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 ()
(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)
"\\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 "\\)"
'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+\\|\\[[^]]+\\]\\)\\)"
(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)
"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.
(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 "*")
(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?(\\)"
(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
(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)
;; [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 ';'
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)
(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)))