帮助中心

# indexOfByRegExp-通过正则获取文本位置

调用indexOfByRegExp函数通过正则获取指定子文本位置。

最小支持版本:5.0.0

# 接口说明

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

# 语法

<String object>.indexOfByRegExp(<reg>, <beginPos>, false)
1
<String object>.通过正则获取文本位置(<reg>, <beginPos>, false)
1

# 函数类型

实例函数

# 请求参数

参数名称 类型 是否必选 默认值 示例值 描述
reg Cube.Lang.String "a" 正则表达式。
beginPos Cube.Lang.Number 1 开始搜索的位置。
caseSensitive Cube.Lang.Boolean true true 大小写是否敏感。取值:
true:是
false:否

# 返回参数

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

# 请求示例

“abc”.indexOfByRegExp("a", 1, true)
1
最近更新时间: { "value": "2023-09-12", "effect": true }