# HG changeset patch # User Richard M. Stallman # Date 882670117 0 # Node ID d884af34ba47547422895d5732a95135c6ebef3d # Parent c383d1397e1249d3ae030b307c03a289d42b59d9 (match-string-no-properties): New function. diff -r c383d1397e12 -r d884af34ba47 lisp/subr.el --- a/lisp/subr.el Sun Dec 21 02:07:32 1997 +0000 +++ b/lisp/subr.el Sun Dec 21 02:08:37 1997 +0000 @@ -978,6 +978,21 @@ (substring string (match-beginning num) (match-end num)) (buffer-substring (match-beginning num) (match-end num))))) +(defun match-string-no-properties (num &optional string) + "Return string of text matched by last search, without text properties. +NUM specifies which parenthesized expression in the last regexp. + Value is nil if NUMth pair didn't match, or there were less than NUM pairs. +Zero means the entire text matched by the whole regexp or whole string. +STRING should be given if the last search was by `string-match' on STRING." + (if (match-beginning num) + (if string + (let ((result + (substring string (match-beginning num) (match-end num)))) + (set-text-properties 0 (length result) nil result) + result) + (buffer-substring-no-properties (match-beginning num) + (match-end num))))) + (defun split-string (string &optional separators) "Splits STRING into substrings where there are matches for SEPARATORS. Each match for SEPARATORS is a splitting point.