I use very often this simple but very useful function:
(defun _WcmatchAll (text patterns) ; M. Puckett
(vl-every
(function (lambda (p) (wcmatch (strcase text) (strcase p))))
patterns
)
)
Purpose: discard anonymous blocks *X*, *U*, *D* and names starting with "X_"
(_WcmatchAll "*U254" '("[~*]*" "~X_*")) => nil
(_WcmatchAll "*D45t" '("[~*]*" "~X_*")) => nil
(_WcmatchAll "*X4gh" '("[~*]*" "~X_*")) => nil
(_WcmatchAll "X_123" '("[~*]*" "~X_*")) => nil
New Purpose: discard anonymous blocks *X*, *D* and names starting with "X_" but NOT *U* anonymous blocks
(_WcmatchAll "*U254" '("[~*]D*" "[~*]X*" "~X_*")) => nil ?
(_WcmatchAll "*U254" '("[~*]~D*" "[~*]~X*" "~X_*")) => nil ?
(_WcmatchAll "*U254" '("[~*][~D]*" "[~*][~X]*" "~X_*")) => nil ?
???