Returns True if the given string is a POSIX bracket expression (POSIX character class)
from functorflow import f
print(f('is-posix-bracket', '[foo:]]'))
# False
print(f('is-posix-bracket', '[xdigit:]]'))
# False
print(f('is-posix-bracket', '[[:xdigit:]]'))
# True
print(f('is-posix-bracket', '[[:xdigit:]]'))
# True
print(f('is-posix-bracket', '[[:alpha:]123]'))
# True
print(f('is-posix-bracket', '[[:alpha:]123]'))
# True
print(f('is-posix-bracket', '[a-c[:digit:]x-z]'))
# True
print(f('is-posix-bracket', '[:al:]'))
# True
print(f('is-posix-bracket', '[abc[:punct:][0-9]'))
# True
Top comments (0)