fn isValidScheme(scheme: []const u8) bool scheme: []const u8487
488
489
490
491
492
493
494
495
496
497fn isValidScheme(scheme: []const u8) bool {
if (scheme.len == 0) return false;
if (!std.ascii.isAlphabetic(scheme[0])) return false;
for (scheme[1..]) |byte| {
switch (byte) {
'A'...'Z', 'a'...'z', '0'...'9', '+', '-', '.' => continue,
else => return false,
}
}
return true;
}
scheme = ALPHA *( ALPHA / DIGIT / "+" / "-" / "." )