Wildcards not an option in RemoveFromList?

I have a list, selWavesList, of wave names created with wavelist("*", ";", ""). I would like to remove from this list all names that contain a user-entered string. For example:

selWavesList = "Freeze_Duration_DM;Freeze_Duration_DM_v2;Freeze_Duration_DM_v3"

I want to remove all items with "DM_", which in this case are the second and third items in the list. The desired result is "Freeze_Duration_DM". I was hoping that the following would work:

selWavesList = removeFromList("DM_*", selWavesList)

...but it does not. The list remains unchanged. Is removeFromList limited to removing one item at a time, or am I using the wildcard incorrectly?

I don't think you can use wildcards in RemoveFromList. Have a look at GrepList which supports regular expressions.

// returns listStr, purged of any items that match an item in ZapListStr.
// Wildcards okay! Case insensitive.
function/S RemoveFromListWC(string listStr, string zapListStr)
    string removeStr = ""
    int i
    for (i=ItemsInList(zapListStr)-1;i>=0;i-=1)
        removeStr += ListMatch(listStr, StringFromList(i, zapListStr))
    endfor
    return RemoveFromList(removeStr, listStr, ";", 0)
end

 

string selWavesList = "Freeze_Duration_DM;Freeze_Duration_DM_v2;Freeze_Duration_DM_v3"
print GrepList(selWavesList, "DM_" ,1 )
>  Freeze_Duration_DM;