Returns 1 or 0 if it founds in the text the regular expression.
1 string.regexp
<string.regexp>
<text /> !
<pattern /> !
</string.regexp>
Arguments | |||||
---|---|---|---|---|---|
Name | Type | Required | Unique | Nullable | Description |
Etext | string | Value which should be replaced in the text, in the corresponding position. | |||
Epattern | string | Value which should be replaced in the text, in the corresponding position. |
Returns | |
---|---|
Type | Description |
boolean | Returns 1 or 0 if the regular expression is found in the text. |
Exceprions
requires 2 arguments, received: ...
The 2 entry parameters has not been specified.
Example
Copy
<xsql-script name='string_regexp_sample1'> <body> <set name='text1'>test.sql</set> <set name='pattern1'>.*\.sql</set> <println> <string.regexp> <text1 /> <pattern1 /> </string.regexp> </println> <set name='text2'>test.asql</set> <set name='pattern2'>.*\.sql</set> <println> <string.regexp> <text2 /> <pattern2 /> </string.regexp> </println> </body> </xsql-script>
Returns:
Copy
true false
Example
Conditional comparation between a list of values.
Copy
<xsql-script name='string_regexp_sample2'> <body> <set name='text1'>RET</set> <set name='pattern1'><string>(CON|RET|HOR|CAU)</string></set> <println> <string.regexp> <text1 /> <pattern1 /> </string.regexp> </println> </body> </xsql-script>
Returns:
Copy
true