Houdini 21.0 Nodes APEX nodes

dict::PatternRenameKeys

Performs pattern replacement on the keys of a dictionary.

On this page
Since 21.0

Performs pattern replacement on the dictionary keys that match the keys pattern.

For example, to replace the hand key with foot:

keys

pattern

hand

foot

If pattern contains an *, the original key replaces the * in pattern to form the new key. For example, to add the prefix test_ to all the keys:

keys

pattern

*

test_*

To add the prefix test_ to the keys that end with _t:

keys

pattern

*_t

test_*

The dict ports of this node are in-place ports, which means the dictionary is updated without creating a copy.

Inputs

*dict: Dict Required

A dictionary with the keys to rename.

keys: String

A pattern of the keys to update in the input dictionary.

pattern: String

The pattern used to rename the keys in the input dictionary.

Outputs

*dict: Dict

The dict input with its keys renamed.

See also

APEX nodes