I’m trying to filter out some objects based on an attribute property in C#. I’ve decided to do this based on comparing two comma delimited lists such that:
- “a,b,c” ~ “a,b,c”, “a,c,b”, “c,a,b”, etc..
- “a,b,*” ~ “a,b,c”, “a,d,b”, “g,a,b”, “a,b”, etc..
- “a,b,c” !~ “a,c,d”, “a,c”, “a”, etc..
I figure you should be able to do this with a simple regex match expression but I can’t figure it out as yet.
Anyone know how to do this? In the mean time going to brute force it with code.
Thanks in advance
–EDIT
by ~ I mean equivalent, sorry for confusion.
also “a,b,c” could also be “abra,barby,candybar”. Its not single characters but a list of values.
It’s not a regular expression, but it’s much simpler than any one could possibly be.
If you find a *, leave off one half of the
&&expression.