帮助中心

# countByRegExp-通过正则正则统计文本数量

调用函数countByRegExp通过正则正则统计指定子文本数量。

最小支持版本:5.0.0

# 接口说明

已构建Cube.Lang.String临时对象。

# 语法

<String object>.countByRegExp(<reg>, false)
1
<String object>.通过正则正则统计文本数量(<reg>, false)
1

# 函数类型

实例函数

# 请求参数

参数名称 类型 是否必选 默认值 示例值 描述
reg Cube.Lang.String "文" 正则表达式。
caseSensitive Cube.Lang.Boolean true true 大小写是否敏感。取值:
true:是
false:否

# 返回参数

参数名称 类型 示例值 描述
Result Cube.Lang.Number 1.0 子文本的数量。

# 请求示例

"文本1".containsByRegExp("文", true)
1
最近更新时间: { "value": "2023-09-12", "effect": true }