I need to filter a set of strings with a wildcard-type search, like the following:
- Looking for
He*lo
should match "Hello", but not "Helo"
- Looking for
*ant
should match "pant" and "want" but not "ant"
- Looking for
*yp*
should match "gypsy" and "typical"
The *
represents one or more characters. I don't mind a handwritten or regex-based search. Any ideas? The typical .NET approach for wildcards matches 0 or more, but I need 1 or more characters. How can I do this?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…