go-rfc2234/gendelims.go

14 lines
317 B
Go
Raw Normal View History

2023-10-04 08:37:55 +00:00
package rfc2234
// IsGenDelim returns true if the value of 'r' matches 'sub-delims' as defined in IETF RFC-2234:
//
// gen-delims = ":" / "/" / "?" / "#" / "[" / "]" / "@"
func IsGenDelim(r rune) bool {
switch r {
case ':' , '/' , '?' , '#' , '[' , ']' , '@':
return true
default:
return false
}
}