![]() | Fun 0.41.5 The programming language that makes You have fun |
VM opcode snippet for OP_REGEX_SEARCH (POSIX first-match search). More...
Go to the source code of this file.
Functions | |
| if (str.type !=VAL_STRING||pattern.type !=VAL_STRING) | |
| void map_set & | m ("") |
| void map_set & | m (-1) |
| free_value (pattern) | |
| free_value (str) | |
| push_value (vm, m) | |
Variables | |
| case | OP_REGEX_SEARCH |
| Value | str = pop_value(vm) |
| Value | m = make_map_empty() |
| Value | emptyArr = make_array_from_values(NULL, 0) |
| break | |
VM opcode snippet for OP_REGEX_SEARCH (POSIX first-match search).
Finds the first match of a POSIX regular expression within an input string and returns a map with details about the match and captured groups.
Behavior (stack effects):
Platform notes:
Errors:
Example:
Definition in file regex_search.c.
| free_value | ( | pattern | ) |
| free_value | ( | str | ) |
| if | ( | str.type ! | = VAL_STRING || pattern.type != VAL_STRING | ) |
Definition at line 47 of file regex_search.c.
| void map_set & m | ( | "" | ) |
| void map_set & m | ( | - | 1 | ) |
| push_value | ( | vm | , |
| m | ) |
| break |
Definition at line 62 of file regex_search.c.
| Value emptyArr = make_array_from_values(NULL, 0) |
Definition at line 57 of file regex_search.c.
| void map_set& m = make_map_empty() |
Definition at line 53 of file regex_search.c.
| case OP_REGEX_SEARCH |
Definition at line 44 of file regex_search.c.
| Value str = pop_value(vm) |
Definition at line 46 of file regex_search.c.