| name | type | required | default | desc |
|---|---|---|---|---|
| pattern | string | true | 正则(可传纯 pattern,也可传带分隔符的完整表达式) | |
| flags | string | false | 修饰符:i/m/s/u/x 等(仅在 pattern 不带分隔符时生效) | |
| text | string | true | 待匹配文本 | |
| global | int | false | 1 | 是否全局匹配(1 是,0 否) |
| name | type | desc |
|---|---|---|
| data.ok | bool | 是否执行成功 |
| data.count | int | 匹配次数 |
| data.matches | mixed | 匹配结果 |