Active Directory Badge Authentication prefix and suffix problems

Hi everyone,
I have a problem that I can't seem to find a solution for in any of the documentations or after trolling through posts on the forum. This post here is the closest thing to my situation, but I have some key differences.

My problem is that my badge number in Active Directory is only a subset of what you get when you get the values from the badge. I know my format is always going to be XXXXXXXX<8 character badge id>YYYYYYY but the values for X and Y aren't predictable so I can't append them in a badge lookup query.

Ideally, I would do a substring and grab the 8-character badge ID out of the middle of the string and check that against the badge values stored in Active Directory, but there doesn't seem to be a way to do that.

Is there a solution to this problem, or am I just out of luck?

Huh. Looks like something worth a formal feature request. (On the Ideas portal.)