I am looking for a regular expression that would allow me filter a list of strings made of an arbitrary number of words whose last character of the last word must be less than or equal to a given integer. The last word of each of the target strings in the list is always Child<1 to 10>. For example:
List<string> attributes = new List<string>
{
"First Name of Child1",
"Last Name of Child1",
"Age of Child1",
"Shipping Instructions",
"First Name of Child2",
"Last Name of Child2",
"Age of Child2",
"Non-Profit Name",
"First Name of Child3",
"Last Name of Child3",
"Age of Child3",
}
If the target integer is 2, the filtered list would contain:
"First Name of Child1",
"Last Name of Child1",
"Age of Child1",
"First Name of Child2",
"Last Name of Child2",
"Age of Child2"