Parsing attributes for dynamic groups

Hello :-)

I have a need for preferably a dynamic group that can parse an attribute and compare to a list of values.

Example -  ADUser  Title attribute - "F387-IT Operations Manager"    

I need to parse the value before the "-" for "F387", then look up that value in a list of up to 4500 values to see if there's a match.

If there is a match, then I want the AD user to be a member of the dynamic group.

How can I build this in a way is dynamic and yet performance doesn't take a hit?   For reference, I've got >40K ADUsers.   Doing "Get-ADUser -filter {...}"  takes 30+ seconds across all 40K users.

Regards,

Jon