getMatchingParticipantIds function

Gets a list of IDs of participants that match a particular pattern