I see, tough one...Well, I think, you would only have to check the first index: 7, and the last one.
Looking at the expressions available maybe these could help also. You could use the comma separator, check the first and last value, and info not found use the ,7,?
tokenat(src, index, separator)
Return the Nth token from src, splitting the string by separator. For example, tokenat("apples|oranges|bananas", 1, "|") returns oranges.
tokencount(src, separator)
Count how many tokens occur in src using separator. For example, tokencount("apples|oranges|bananas", "|") returns 3.
Im not sure if you could send the list to an array and then cycle through that also...just kind of brainstorming at this point.