Suppose you have a list of acronym's that define a value (ex. AB1,DE2,CC3) and you need to check a string value (ex. "Happy:DE2|234") to see if an acronym is found in the string. For a short list of acronym's I would usually create a simple RegEx that used a separator (ex. (AB1|DE2|CC3) ) and just look for a match.
But how would I tackle this if there are over 30 acronym's to match against? Would it make sense to use the same technique (ugly) or is there a more effecient and elegant way to accomplish this task?
Keep in mind the example acronym list and example string is not the actual data format that I am working with, rather just a way to express my challenge.
BTW, I read a SO related question but didn't think it applied to what I was trying to accomplish.
Thanks in advance!
EDIT: I forgot to include my need to capture the matched value, hence the choice to use Regular Expressions...