
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello all,
Thank you for considering to answer my question here.
So i have many variations of "structure IDs" this one in particular is "stk 55[3C] P1"
I have the structure of a program to go search all cogo point description and find my structure number ("stk 55[3C] P1")
However, I am having issues on the matching part.
The names varry and could have [] or - or _ so i tried using LeeMacs Code but cant get it to work.
I have attached the code i have been working on as well- its a little messy as i am still working on it
http://www.lee-mac.com/escapewildcards.html - here is the like to lee macs code i waas trying to use
;; Escape Wildcards - Lee Mac
;; Escapes wildcard special characters in a supplied string
(defun LM:escapewildcards ( str )
(if (wcmatch str "*[-#@.*?~`[`,]*,*`]*")
(if (wcmatch str "[-#@.*?~`[`,]*,`]*")
(strcat "`" (substr str 1 1) (LM:escapewildcards (substr str 2)))
(strcat (substr str 1 1) (LM:escapewildcards (substr str 2)))
)
str
)
)
(LM:escapewildcards "stk 55[3C] P1" )
(WCMATCH "stk 55[3C] P1"(LM:escapewildcards "55[3C]"))
Escentally would this not work for matching up with any string to any pattern?
what am i doing wrong and what could be the solution?
Solved! Go to Solution.