I want to check if a string contains a word or number from a list and remove it from the string.

I want to use `Enumerable.Range()` to create the filter list and use it to filter many different strings.

I'm trying to combine two previous answers:  

<https://stackoverflow.com/a/49733139/6806643>  

<https://stackoverflow.com/a/49740832/6806643> 

---

**The sentence I want to filter:**

> 
> This is a A05B09 hello 02 100 test
> 
> 
> 

---

**Filter**

`A00B00-A100B100`, `01-100`, `000-100`, `hello`

Should read:

> 
> This is a test
> 
> 
> 

---

**Old Way**  

`For Loop` - Works  

<http://rextester.com/BJL70824>

**New Way**  

`Enumerable Range List` - Does not work  

<http://rextester.com/ZSCM64375>

---

**C#**

```
List<List<string>> filters = Enumerable.Range(0, 101)
       .SelectMany(a => Enumerable.Range(0, 101).Select(b => "A{0:00}B{1:00}"))
       .Select(i => Enumerable.Range(0, 10).Select(c => string.Empty).ToList())
           .SelectMany(a => Enumerable.Range(0, 101).Select(b => "{0:000}"))
           .SelectMany(a => Enumerable.Range(0, 101).Select(b => "{0:00}"))
           .SelectMany(a => Enumerable.Range(0, 1).Select(b => "hello"))
           .ToList();

List<string> matches = new List<string>();

// Sentence
string sentence = "This is a A05B09 hello 02 100 test";
string newSentence = string.Empty;

// Find Matches
for (int i = 0; i < filters.Count; i++)
{
    // Add to Matches List
    if (sentence.Contains(filters[i].ToString()))
    {
        matches.Add(filters[i]);
    }
}

// Filter Sentence
newSentence = Regex.Replace(
    sentence
,   @"(?<!\S)(" + string.Join("|", matches) + @")(?!\S)"
,   ""
,   RegexOptions.IgnoreCase
);

// Display New Sentence
Console.WriteLine(newSentence);

```