- 授权协议: 未知
- 开发语言: JavaScript
- 操作系统: 跨平台
- 软件首页: https://github.com/JonAbrams/xeger
软件介绍
Xeger 是更富有表现力的 JavaScript 正则表达式,Xeger 发音为 "zeeger"。
使用:
var xeger = require('xeger');
/* Parsing a URL. Getting the schema, host, path, and url params */
/* Instead of this */
var boringRegex= /(https?)\:\/\/([^\/]+)(.+)\?(.*)/;
/* Write this! */
var coolRegex = xeger(function (x) {
/* schema */
x.group(function (x) {
x.literal('http');
x.literal('s', { optional: true });
});
x.literal('://');
/* host */
x.group(function (x) {
x.not('/', { multiple: true });
});
/* path */
x.group(function (x) {
x.any({ multiple: true });
});
x.literal('?');
/* query params */
x.group(function (x) {
x.any({ multiple: true, optional: true });
});
});
var matched = coolRegex.exec('https://www.google.com/search?q=my_search');匹配:
[ 'https://www.google.com/search?q=my_search', 'https', /* schema */ 'www.google.com', /* host */ '/search', /* path */ 'q=my_search', /* query params */ index: 0, input: 'https://www.google.com/search?q=my_search' ]
Go语言学习笔记
雨痕 / 电子工业出版社 / 2016-6 / 89
作为时下流行的一种系统编程语言,Go 简单易学,性能很好,且支持各类主流平台。已有大量项目采用 Go 编写,这其中就包括 Docker 等明星作品,其开发和执行效率早已被证明。本书经四年多逐步完善,内容覆盖了语言、运行时、性能优化、工具链等各层面知识。且内容经大量读者反馈和校对,没有明显的缺陷和错误。上卷细致解析了语言规范相关细节,便于读者深入理解语言相关功能的使用方法和注意事项。下卷则对运行时源......一起来看看 《Go语言学习笔记》 这本书的介绍吧!
JSON 在线解析
在线 JSON 格式化工具
XML、JSON 在线转换
在线XML、JSON转换工具
