Returns an array with the groups of the regular expression which are in the string.
1 regex.find
<regex.find include_nulls='include_nulls'>
<text /> !
<pattern /> !
</regex.find>
Attributes | |||||
---|---|---|---|---|---|
Name | Type | Required | Default | Description | |
Ainclude_nulls | boolean | false | Indicator to include the nulls in the array with the matches. |
Arguments | |||||
---|---|---|---|---|---|
Name | Type | Required | Unique | Nullable | Description |
Etext | String | String of text in which you want to search. | |||
Epattern | String | Pattern to search in the regular expression. |
Returns | |
---|---|
Type | Description |
Array | Returns an array with all the matches of all the groups of the regular expression. |
Example
Convert the string of text to regular expression.
Copy
<xsql-script> <args> <arg name='p_cabid' type='integer' /> </args> <body> <set name="m_text"><string>SELECT test_get_cart_qty_prop(@v_in_linm_seq,'@v_subzon', '@v_linm_hu_type', '@v_hu_code_pro') FROM systables WHERE tabname = 'systables'</string></set> <set name="m_pattern"><string>\@\{(\w+)\}|[@](\w+)</string></set> <set name="m_res"> <regex.find include_nulls="false"> <m_text /> <m_pattern /> </regex.find> </set> <println><m_res /></println> </body> </xsql-script>
The array obtained is [v_in_linm_seq,v_subzon,v_linm_hu_type,v_hu_code_pro]