Node: Regular Expressions, Next: , Previous: Custom Menus, Up: Top



Element Search/Regular Expressions

Element Search/Regular Expressions

Pcb's search is based on POSIX 1003.2 Regular Expressions. Full POSIX Regular Expressions are supported by Pcb if the regex library was available when Pcb was built. It is easier to show by example how to search than explain POSIX 1003.2. The following table shows the most common Regular Expression characters used to find elements in Pcb:

\
Indicates next character should not be interpreted literally if it normally is, and should be interpreted literally if it normally isn't.
*
Matches 0 or more instances of preceding character.
+
Matches 1 or more instances of preceding character.
?
Matches 0 or 1 instances of preceding character.
.
Matches any single character other than the newline character.

The following examples illustrate how regular expressions are used to specify element names (reference designators) to search for.

Search for "C1":
Enter "C1".
Search for all elements that start with "C", such as capacitors:
Enter "C.*", that is "C-dot-star".
Search for all elements that start with "C" and end with "1",
such as "C1", or "C51": Enter "C.*1", that is "C-dot-star-1".
Search for only R1 or R10, will not match R100:
Enter "R10?".
Search for all parts starting with "R12" and ending with the number eight, or eighty-eight etc:
Enter "R128+".
Search for all terminal blocks having a one digit designator such as TB1 or TB2:
"TB.", that is "TB-dot".
Search for all terminal blocks having a two digit designator such as TB21 or TB15:
"TB..", that is "TB-dot-dot".