;; (and line-start ?\n)))
;;
;; "\\$[I]d: [^ ]+ \\([^ ]+\\) "
-;; (rx (and "$Id": "
-;; (1+ (not (in " ")))
+;; (rx (and "$Id": "
+;; (1+ (not (in " ")))
;; " "
;; (submatch (1+ (not (in " "))))
;; " ")))
;; etc.
;;; History:
-;;
+;;
;;; Code:
(while (and (not (null op)) (symbolp op))
(setq op (cdr (assq op rx-constituents))))
op)
-
+
(defun rx-check (form)
"Check FORM according to its car's parsing info."
(defun rx-kleene (form)
"Parse and produce code from FORM.
FORM is `(OP FORM1)', where OP is one of the `zero-or-one',
-`zero-or-more' etc. operators.
+`zero-or-more' etc. operators.
If OP is one of `*', `+', `?', produce a greedy regexp.
If OP is one of `*?', `+?', `??', produce a non-greedy regexp.
If OP is anything else, produce a greedy regexp if `rx-greedy-flag'
(op (cond ((memq (car form) '(* *? 0+ zero-or-more)) "*")
((memq (car form) '(+ +? 1+ one-or-more)) "+")
(t "?"))))
- (format "\\(?:%s\\)%s%s" (rx-to-string (cadr form) 'no-group)
+ (format "\\(?:%s\\)%s%s" (rx-to-string (cadr form) 'no-group)
op suffix)))
(cdr (assq form rx-categories)))
(error "Unknown category `%s'" form))
t)
-
+
(defun rx-category (form)
"Parse and produce code from FORM, which is `(category SYMBOL ...)'."
info)
((null info)
(error "Unknown Rx form `%s'" form))
- (t
+ (t
(funcall (nth 0 info) form)))))
((consp form)
(let ((info (rx-info (car form))))
matches any character in SET. SET may be a character or string.
Ranges of characters can be specified as `A-Z' in strings.
-'(in SET)'
+'(in SET)'
like `any'.
`(not (any SET))'
still match. A non-greedy regexp matches as little as possible.
`(maximal-match SEXP)'
- produce a greedy regexp for SEXP. This is the default.
+ produce a greedy regexp for SEXP. This is the default.
`(zero-or-more SEXP)'
matches zero or more occurrences of what SEXP matches.
`(one-or-more SEXP)'
matches one or more occurrences of A.
-
+
`(1+ SEXP)'
like `one-or-more'.
`(zero-or-one SEXP)'
matches zero or one occurrences of A.
-
+
`(optional SEXP)'
like `zero-or-one'.
matches N to M occurrences of what SEXP matches.
`(eval FORM)'
- evaluate FORM and insert result. If result is a string,
+ evaluate FORM and insert result. If result is a string,
`regexp-quote' it.
`(regexp REGEXP)'