To me this one is more flexible:
(defun _WCMatchList ( lst pattern ignorecase )
( (lambda ( foo pattern ) (vl-remove-if-not 'foo lst))
(if ignorecase
(lambda (x) (wcmatch (strcase x) pattern))
(lambda (x) (wcmatch x pattern))
)
(if ignorecase (strcase pattern) pattern)
)
)
Given there's no guarantee all the strings are the same case it affords the caller the ability to ignore or honor the case.
Sample data with mixed case strings.
(setq lst
'(
"P-BLDG,3,CONTINUOUS"
"P-BLDG-H,9,CONTINUOUS"
"P-BLDG-T,10,CONTINUOUS"
"P-BNDRY,7,CONTINUOUS"
"P-BNDRY-T,3,CONTINUOUS"
"P-CANOPY,2,HIDDEN4"
"P-CANOPY-T,10,CONTINUOUS"
"P-CL,2,CENTER2"
"P-CONC,10,CONTINUOUS"
"P-CONC-H,9,CONTINUOUS"
"P-CONC-T,10,CONTINUOUS"
"P-DECK,11,CONTINUOUS"
"P-DECK-T,11,CONTINUOUS"
"P-ELEC,242,PROPOVERHEAD UTILITIES"
"P-ELEC-T,242,CONTINUOUS"
"P-ELEC_B,242,PROP BE"
"P-ELEC_B-T,242,CONTINUOUS"
"P-FENCE,6,PROP FENCE"
"P-FENCE-T,6,CONTINUOUS"
"P-FO,242,PROP FIBER OPTIC"
"P-FO-T,242,CONTINUOUS"
"P-GAP-T,32,CONTINUOUS"
"P-GAS,32,PROP GAS MAIN"
"P-LOT,7,CONTINUOUS"
"P-MISC,10,CONTINUOUS"
"P-MISC-T,10,CONTINUOUS"
"P-MON,6,CONTINUOUS"
"P-MON-T,6,CONTINUOUS"
"p-pavmt,11,continuous"
"p-pavmt-t,11,continuous"
"p-pool,172,continuous"
"p-pool-t,172,continuous"
"p-riprap,10,continuous"
"p-riprap-t,10,continuous"
"p-roadname,4,continuous"
"p-rw,6,phantom2"
"p-rw-t,6,continuous"
"p-sewer,92,prop sewer"
"p-sewer-t,92,continuous"
"p-sign,10,continuous"
"p-sign-t,10,continuous"
"p-storm,172,prop storm"
"p-storm-t,172,continuous"
"p-strip,9,continuous"
"p-strip-t,9,continuous"
"p-tele,242,prop ot"
"p-tele-t,242,continuous"
"p-topo,252,hidden2"
"p-topo-h,242,hidden2"
"p-trees,8,hidden2"
"p-wall,2,continuous"
"p-wall-t,10,continuous"
"p-water,132,prop water main"
"p-water-t,132,continuous"
)
)
Honor the case:
(_WCMatchList lst "P-*`,*`,CONTINUOUS" nil)
"P-BLDG,3,CONTINUOUS"
"P-BLDG-H,9,CONTINUOUS"
"P-BLDG-T,10,CONTINUOUS"
"P-BNDRY,7,CONTINUOUS"
"P-BNDRY-T,3,CONTINUOUS"
"P-CANOPY-T,10,CONTINUOUS"
"P-CONC,10,CONTINUOUS"
"P-CONC-H,9,CONTINUOUS"
"P-CONC-T,10,CONTINUOUS"
"P-DECK,11,CONTINUOUS"
"P-DECK-T,11,CONTINUOUS"
"P-ELEC-T,242,CONTINUOUS"
"P-ELEC_B-T,242,CONTINUOUS"
"P-FENCE-T,6,CONTINUOUS"
"P-FO-T,242,CONTINUOUS"
"P-GAP-T,32,CONTINUOUS"
"P-LOT,7,CONTINUOUS"
"P-MISC,10,CONTINUOUS"
"P-MISC-T,10,CONTINUOUS"
"P-MON,6,CONTINUOUS"
"P-MON-T,6,CONTINUOUS"
(_WCMatchList lst "p-*`,*`,continuous" nil)
"p-pavmt,11,continuous"
"p-pavmt-t,11,continuous"
"p-pool,172,continuous"
"p-pool-t,172,continuous"
"p-riprap,10,continuous"
"p-riprap-t,10,continuous"
"p-roadname,4,continuous"
"p-rw-t,6,continuous"
"p-sewer-t,92,continuous"
"p-sign,10,continuous"
"p-sign-t,10,continuous"
"p-storm-t,172,continuous"
"p-strip,9,continuous"
"p-strip-t,9,continuous"
"p-tele-t,242,continuous"
"p-wall,2,continuous"
"p-wall-t,10,continuous"
"p-water-t,132,continuous"
Ignore the case.
(_WCMatchList lst "p-*`,*`,continuous" t)
"P-BLDG,3,CONTINUOUS"
"P-BLDG-H,9,CONTINUOUS"
"P-BLDG-T,10,CONTINUOUS"
"P-BNDRY,7,CONTINUOUS"
"P-BNDRY-T,3,CONTINUOUS"
"P-CANOPY-T,10,CONTINUOUS"
"P-CONC,10,CONTINUOUS"
"P-CONC-H,9,CONTINUOUS"
"P-CONC-T,10,CONTINUOUS"
"P-DECK,11,CONTINUOUS"
"P-DECK-T,11,CONTINUOUS"
"P-ELEC-T,242,CONTINUOUS"
"P-ELEC_B-T,242,CONTINUOUS"
"P-FENCE-T,6,CONTINUOUS"
"P-FO-T,242,CONTINUOUS"
"P-GAP-T,32,CONTINUOUS"
"P-LOT,7,CONTINUOUS"
"P-MISC,10,CONTINUOUS"
"P-MISC-T,10,CONTINUOUS"
"P-MON,6,CONTINUOUS"
"P-MON-T,6,CONTINUOUS"
"p-pavmt,11,continuous"
"p-pavmt-t,11,continuous"
"p-pool,172,continuous"
"p-pool-t,172,continuous"
"p-riprap,10,continuous"
"p-riprap-t,10,continuous"
"p-roadname,4,continuous"
"p-rw-t,6,continuous"
"p-sewer-t,92,continuous"
"p-sign,10,continuous"
"p-sign-t,10,continuous"
"p-storm-t,172,continuous"
"p-strip,9,continuous"
"p-strip-t,9,continuous"
"p-tele-t,242,continuous"
"p-wall,2,continuous"
"p-wall-t,10,continuous"
"p-water-t,132,continuous"
Mileages vary, this is mine.
Cheers.