nv-string-idtag
v1.0.4
Published
nv-string-idtag =============== - nv-string-idtag - parse/unparse a simple format: - the valid chars can BE [a-z] OR [0-9] OR _ OR $ - the first char can BE [a-z] OR $ - the dollar $ is used as seperator - begin with $ mea
Readme
nv-string-idtag
nv-string-idtag
parse/unparse a simple format:
the valid chars can BE [a-z] OR [0-9] OR _ OR $the first char can BE [a-z] OR $the dollar $ is used as seperatorbegin with $ means a abs pathend with $ means a dir pathfor test const-string-pool feature in nvlang , normally USELESS
install
- npm install nv-string-idtag
usage
const {
is_valid_idtag,
parse,
unparse,
} = require("nv-string-idtag") example
> is_valid_idtag("_a")
false
>
> is_valid_idtag("0abc")
false
>
> parse('abc_def');
[ 'abc_def' ]
> parse('$abc_def');
[ '', 'abc_def' ]
> parse('abc_def$');
[ 'abc_def', '' ]
> parse('abc_def$xyz');
[ 'abc_def', 'xyz' ]
> parse('$abc_def$xyz');
[ '', 'abc_def', 'xyz' ]
> parse('$abc_def$xyz$hij_lmn');
[ '', 'abc_def', 'xyz', 'hij_lmn' ]
> parse('$abc_def$xyz$hij_lmn$');
[ '', 'abc_def', 'xyz', 'hij_lmn', '' ]
>
> unparse([ '', 'abc_def', 'xyz', 'hij_lmn', '' ])
'$abc_def$xyz$hij_lmn$'API
- is_valid_idtag(s)
- parse(s)
- unparse(arr)
LICENSE
- ISC
