help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

regexps that match and don't match


From: Emanuel Berg
Subject: regexps that match and don't match
Date: Sat, 06 Jan 2018 03:10:21 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4 (gnu/linux)

Did anyone think of doing something like this?

    (defun re-match-white-black (string re-white re-black)
      (let ((white (string-match re-white string))
            (black (string-match re-black string)) )
        (and white (not black)) ))
    ;; (re-match-white-black "aaab" ".*b" "z.*") ; t
    ;; (re-match-white-black "baab" ".*b" "z.*") ; t
    ;; (re-match-white-black "aaac" ".*b" "z.*") ; nil
    ;; (re-match-white-black "zaab" ".*b" "z.*") ; nil
    ;; (re-match-white-black "zaac" ".*b" "z.*") ; nil

-- 
underground experts united
http://user.it.uu.se/~embe8573


reply via email to

[Prev in Thread] Current Thread [Next in Thread]