Product Documentation
Cadence SKILL Language Reference
Product Version IC23.1, November 2023

rexMatchAssocList

rexMatchAssocList( 
t_pattern 
l_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

t_pattern

Regular expression pattern.

l_targets

Association list whose keys are strings and/or symbols.

Value Returned

l_results

New association list of elements that are in l_targets and whose keys match t_pattern.

nil

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

String Functions

rexCompile

rexExecute

rexMatchp

rexMatchList


Return to top
 ⠀
X