(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 ?
???
Code - Auto/Visual Lisp: [Select]??
(_wcmatchall "*U254" '("~`*~D*" "~`*~X*" "~X_*"))
(_wcmatchall "*U254" '("~`*~D*" "~`*~X*" "~X_*")) => T OK
(_wcmatchall "X_123" '("~`*~D*" "~`*~X*" "~X_*")) => nil OK
(_wcmatchall "*D45t" '("~`*~D*" "~`*~X*" "~X_*")) => T must be nil
(_wcmatchall "*X4gh" '("~`*~D*" "~`*~X*" "~X_*")) => T must be nil
New Purpose: discard anonymous blocks *X*, *D* and names starting with "X_" but NOT *U* anonymous blocks
(all other names are ok)
(_wcmatchall "Abcde" '("~`*[DX]*" "~X_*")) => T OK
(_wcmatchall "*U254" '("~`*[DX]*" "~X_*")) => T OK
(_wcmatchall "X_123" '("~`*[DX]*" "~X_*")) => nil OK
(_wcmatchall "*D45t" '("~`*[DX]*" "~X_*")) => nil OK
(_wcmatchall "*X4gh" '("~`*[DX]*" "~X_*")) => nil OK
Thanks! :-) It wasn't that simple, grazie mille. :yes:Glad to help :) .. this should work too if you want to use something a bit more legible.Code: [Select]New Purpose: discard anonymous blocks *X*, *D* and names starting with "X_" but NOT *U* anonymous blocks
(all other names are ok)
(_wcmatchall "Abcde" '("~`*[DX]*" "~X_*")) => T OK
(_wcmatchall "*U254" '("~`*[DX]*" "~X_*")) => T OK
(_wcmatchall "X_123" '("~`*[DX]*" "~X_*")) => nil OK
(_wcmatchall "*D45t" '("~`*[DX]*" "~X_*")) => nil OK
(_wcmatchall "*X4gh" '("~`*[DX]*" "~X_*")) => nil OK
Alternatively:Grazie :-)Code - Auto/Visual Lisp: [Select]
No custom function required.