Pattern Match

With the Pattern Match option, you can search and filter your Summary mode text using regular expressions.

Regular expressions provide a powerful, flexible, and efficient method to find text that matches a pattern that you define.

Pattern matches are case insensitive unless you choose Match case from the advanced options.

Common Operators for Expressions

The table below has a few common operators that you can use to build your search expression.

Operators

Description

Examples

.

Use this operator to match any single character, except a newline character.

c.r matches "CIR1", "CIR2", "Car", and "Corosive" but not "Cody".

*

Use this operator to match zero or more instances of the preceding token or character. This matches as many characters as possible (greedy).

  • Precede this character with . to match one or more instances of any character.

  • Follow this character with ? to match as few characters as possible (lazy).

C*r matches “CIR1” and “SPHERE1”

In the phrase “CIR1 CIR2”, c.*r matches “CIR1 CIR2” (greedy)

But c.*?r matches “CIR1 CIR2” (lazy)

+

Use this operator to match one or more instances of the preceding token or character.

As discussed in the row above, you can follow this with ? to make the search lazy and match as few characters as possible.

L+1 matches "ELL1" and "CYL1" but not "CYL2"

^

Use this operator to match the beginning of a line followed by the text that begins the line.

^cir matches “CIR1 = CIRCLE(CONTACT)” but not “FCFCIRTY1 Passed : CIR1”.

$

Use this operator to match text that is at the end of a line. You must place the text that you want to search before this operator.

And$ matches “MOVESET1 = MovesetCommand”.

[a-f]

Use square brackets to match any single character from a range of characters within the brackets.

S[i-t] matches “Start”, “Sort”, and “Size” but not “Sam”.

|

Use this operator to match either of the strings on either side of the operator. This works similar to an “or” function.

Active (Workplane|Tip) matches "Active Workplane" and "Active Tip" but not "Active Role".

\

Use this operator to suppress special meaning in any character or token after the operator.

\+ matches the text “ASSIGNMENT(V1 = 10+5)” rather than treating the + character as a regular expression operator.

\w

Use this operator to match any single character in a whole word.

Mo\we matches “Mode” and “Move” but not “Motor”.

\s

Use this operator to match any whitespace character.

Manual\sMode matches “Manual Mode” but not “Manual-Mode”.

\d

Use this operator to search any decimal digit character.

t\d matches “T1A0B0” but not “tip” or “top”

?

Use this operator to match the preceding token zero or once. (In essence, this makes the preceding token optional.)

You can also use this token to make a search lazy (non-greedy). See* and + above.

m\w+? matches “command” and “Alignment”.

\+?2 matches “3 + 2” and “32”.

(lar)

Use parentheses to group the characters within them together as a single token.

c.rc.(lar)? matches “circle” and “circular” and “circumference”.

Regular expressions can be difficult to understand and the information here, provides some basics. For additional information and examples on regular expressions, we invite you to consult trusted resources on the Internet.