AnimGraphLab Alpha

Pattern matching is a powerful, text-based method for selecting multiple items (shapes, points, etc.) at once. It’s used in parameters like Group and Indices in nodes such as Group, Light, and Transform.

There are two types of pattern matching: Name Matching for selecting items by their label, and Index Matching for selecting items by their position.

Name Matching

This method is used to select shapes based on their Label property.

  • Wildcards: Use * to match any sequence of characters and ? to match any single character.
  • Exclusion: Start a pattern with ^ to exclude items that match.
  • Multiple Patterns: Separate multiple patterns with a comma , to combine selections.
To match...Use patternDescription
all items starting with "Rectangle"Rectangle*The * acts as a wildcard for any number of characters.
all items with "Temp" in their name*Temp*Wildcards can be used at the beginning and end of a pattern.
"Shape 1", "Shape 2", "Shape A", etc.Shape ?The ? is a wildcard for a single character.
all except those starting with "Box"^Box*The ^ character at the start of a pattern excludes matching items.
starting with "Rect", "Shape 1"Rect*, Shape 1Commas are used to combine multiple patterns.
all items*A single wildcard matches everything. An empty pattern also works.

Index Matching

This method is used to select items based on their numerical order (index). This is common for selecting points within a shape or shapes within a stream of data. Indices are zero-based, meaning the first item is at index 0.

  • Ranges: Use a hyphen - to select a range of indices (e.g., 1-5).
  • Open-Ended Ranges: Leave one side of a range empty to select from the beginning or to the end (e.g., 2- selects from index 2 to the last item).
  • Exclusion: Start a pattern with ^ to exclude specific indices from the selection.
  • Multiple Patterns: Separate multiple patterns with a comma ,.
To match...Use patternDescription
only the 6th item5Indices are zero-based, so the 6th item is at index 5.
the 2nd through 6th items1-5Selects an inclusive range of indices.
all items from the 3rd item onwards2-An open-ended range selects from the start index to the end of the list.
the first 4 items (indices 0 to 3)-3An open-ended range selects from the beginning up to the end index.
all items except the first one^0The ^ character excludes the specified index or range.
the 2nd, 4th, and 6th items1, 3, 5Commas are used to select multiple specific indices.
items 1-11 and 13 onwards, but not item 60-10, ^5, 12-Patterns are evaluated in order: inclusions are added, then exclusions are removed.
all items* or (empty)A wildcard or an empty string selects all available indices.