Abstract checking for string beginning matches