isValidPosixName
lib.strings.isValidPosixName
Docs pulled from | This Revision | 10 minutes ago
Test whether the given name
is a valid POSIX shell variable name.
Inputs
name
- 1. Function argument
Type
string -> bool
Examples
lib.strings.isValidPosixName
usage example
isValidPosixName "foo_bar000"
=> true
isValidPosixName "0-bad.jpg"
=> false
Noogle detected
Implementation
The following is the current implementation of this function.
isValidPosixName = name: match "[a-zA-Z_][a-zA-Z0-9_]*" name != null;