This Tech Tip explains how to use a regular expression (also known as regex) in CIMCO Edit’s Insert String feature to find matching patterns and insert text across multiple lines of an NC program in one pass.
Insert String in NC Functions / Insert-Remove adds text at a specified location relative to a matched string. Most people configure it with a plain text match and move on.
Switch to a regular expression and the feature changes character entirely. A plain text match finds one specific string. A regex match finds a pattern.
If you need to insert a comment or macro call after every tool change in a program, a regex targeting the T-call pattern handles every instance in one pass, regardless of tool number, regardless of how many there are. You define the pattern once and let it work through the program.
Test the expression on a representative section before applying it to the full file. Once you have it right, it applies correctly to every matching line without you touching a single one individually.
Want to see what else CIMCO Edit can do with NC program editing? Check out our CIMCO EDIT product page and explore more about Edit’s capabilities.
If you’d like help configuring your CIMCO software environment, please contact our team. We’re ready to help you make your shop more efficient and more productive.
