string-extractor:用于从字符串中获取数据的正则表达式糖

时间:2021-06-02 20:24:33
【文件属性】:
文件名称:string-extractor:用于从字符串中获取数据的正则表达式糖
文件大小:7KB
文件格式:ZIP
更新时间:2021-06-02 20:24:33
JavaScript 字符串提取器.js 用于从字符串中获取数据的正则表达式糖。 用法 var stringExtractor = require ( 'string-extractor' ) ; var pattern = '*/{{ year: 4d }}-{{ month: d }}-{{ slug }}.((txt|m*))' ; var extract = stringExtractor ( pattern ) ; extract ( 'foo/2014-01-bar.txt' ) ; //=> { year: '2014', month: '01', slug: 'bar' } extract ( 'foo/2014-01-bar.md' ) ; //=> { year: '2014', month: '01', slug: 'bar' } extract ( 'foo/2
【文件预览】:
string-extractor-master
----.travis.yml(227B)
----example()
--------index.js(645B)
----index.js(3KB)
----package.json(764B)
----test()
--------index.js(3KB)
----LICENSE(1KB)
----.gitignore(49B)
----README.md(3KB)
----.jshintrc(292B)
----.editorconfig(147B)

网友评论