Skip to main content

is_portable_variable_name

Function is_portable_variable_name 

Source
pub fn is_portable_variable_name(name: &str) -> bool
Expand description

Tests if a string is a variable name usable in a POSIXly-portable way.

POSIX defines a name as a word consisting solely of underscores, digits, and alphabetics from the portable character set, the first character of which is not a digit. This function returns true if the string is a non-empty word of ASCII alphanumerics and underscores that does not start with a digit.

Note that this function only checks the syntax of the name. Variables with a portable name may still be non-portable to modify in a specific way; see is_portable_readonly_variable_name.