14.5.3 Special well known string formats

Function: mbfl_string_is_username STRING
Function: mbfl_string_is_groupname STRING

Return true if STRING is valid as user name or group name according to the common Unix standards; otherwise return false. STRING must be non–empty, it must not terminate with a newline, it must match the following regular expression:

^(([a-zA-Z0-9_\.\-]+)|(\+[0-9]+))$

As a special case: STRING can be composed of digits with a leading plus sign ‘+’, this is supported by chown and chgrp from the GNU Coreutils as a way to specify numeric user and group name unambiguously; See chown, chgrp, chroot, id Disambiguating user names and IDs.

Function: mbfl_string_is_email_address STRING

Return true if STRING is non–empty and it matches the general shape of an email address; otherwise return false.

Function: mbfl_string_is_network_hostname STRING

Return true if STRING is non–empty and it matches the format of a network hostname; otherwise return false.

Function: mbfl_string_is_network_port STRING

Return true if STRING is non–empty and it matches the format of a network port number; otherwise return false.

Function: mbfl_string_is_network_ip_address STRING

Return true if STRING is non–empty and it matches the format of an IP address; otherwise return false.


This document describes version 3.0.0-devel.9 of Marcos Bash Functions Library.