reg_split 函数
按正则表达式匹配位置切分文本。
语法
StringTools:-RegSplit(pattern, text)RegSplit(pattern, text)reg_split(pattern, text)
参数与选项
pattern | 正则表达式分隔符。 |
|---|---|
text | 要切分的文本。 |
示例
- 正则切分
StringTools:-RegSplit('\\s+', 'one two three')返回 ['one', 'two', 'three']。
按正则表达式匹配位置切分文本。
StringTools:-RegSplit(pattern, text)RegSplit(pattern, text)reg_split(pattern, text)pattern | 正则表达式分隔符。 |
|---|---|
text | 要切分的文本。 |
StringTools:-RegSplit('\\s+', 'one two three')返回 ['one', 'two', 'three']。