@Override
public Result<String> parse(Segment<Character> characters) throws Exception {
CharacterSequence sequence = charSequence(characters);
Matches matches = regex.findMatches(sequence);
if (matches.isEmpty()) return fail(regex, sequence);
return success(matches.head().group(), sequence.remainder());
}
}