rexMatchAssocList
rexMatchAssocList(t_patternl_targets) =>l_results/nil
Description
Returns a new association list created out of those elements of the given association list whose key matches a regular expression pattern. The supplied regular expression pattern overwrites the previously compiled pattern and is used for subsequent matching until the next new pattern is provided.
l_targets is an association list, that is, each element on l_targets is a list with its car taken as a key (either a string or a symbol). This function matches the keys against t_pattern, selects the elements on l_targets whose keys match the pattern, and returns a new association list out of those elements.
Arguments
Value Returned
|
New association list of elements that are in l_targets and whose keys match t_pattern. |
|
|
If no match is found. Signals an error if the given pattern is ill-formed. |
Examples
rexMatchAssocList("^[a-z][0-9]*$"
'((abc "ascii") ("123" "number") (a123 "alphanum")
(a12z "ana")))
=> ((a123 "alphanum"))
Related Topics
Return to top