STRING SEARCH AND MATCHING FOR GATE FUNCTIONALITY