Description:
Match the string members of in the cursor with the regular expression.
Syntax:
cs.regex(rs,Fi,…)
Note:
The function matches the string members in cursor cs with regular expression rs, returns the original cursor whose fields are Fi. It supports multicursors.
Parameters:
cs |
A cursor whose members are strings |
rs |
Regular expression |
Fi |
Resulting field name |
Options:
@c |
Case insensitive |
@u |
Use Unicode to match |
Return value:
The original cursor with new fields
Example:
|
A |
|
1 |
=file("D:\\a.txt").import@ts().(~.array().concat@c()) |
a.txt is a table sequence whose fields are separated by commas |
2 |
=A1.cursor() |
|
3 |
=A1.cursor() |
|
4 |
=A2.regex("(.*),(A.*)";id,name).fetch() |
|
5 |
=A3.regex@c("(.*),(A.*)";id,name).fetch() |
|
6 |
=file("D:\\c.txt":"UTF-8").import@ts().(~.array().concat@c()) |
|
7 |
=A6.cursor() |
|
8 |
=A7.regex@u("(\\u9500\\u552e\\u90e8),(.*)";销售部,员工姓名).fetch() |
Use Unicode to match the Sales Dep. |
Related functions: