1. 首页
  2. 考试认证
  3. 其它
  4. regexp sample 一个非常有限的Regexp#sample方法

regexp sample 一个非常有限的Regexp#sample方法

上传者: 2024-10-22 03:24:19上传 ZIP文件 3.33KB 热度 7次

正则表达式示例一个非常有限的 Regexp#sample 方法。

安装 $ gem install regexp_sample

用法


require \"regexp_sample\"

using RegexpSample

/[a-z0-9]{5}/.sample

#=> \"nt3r6\"

/app[0-9]{5}/.sample(2)

#=> [\"app94832\", \"app04535\"]

版权版权所有 (C) 2014 文森特·奥利维尔。有关详细信息,请参阅许可证。

下载地址
用户评论