From TouchDesigner Documentation
Jump to: navigation, search


The searchReplace Component lets you search and (optionally) replace text in operators. The replace operation is undoable.

It will search and optionally replace all text in DATs, operator names, parameter values/expressions/bind expressions, custom parameter names, custom parameter menu items, custom parameter page names, and fieldCOMP text.

To search a single operator, or a component recursively, set the Searchinop parameter. The first input allows you to provide a table of operators (path column) to search non-recursively. The second input allows you to provide a table of multiple search/replace string options in search and replace columns.



Version Version - Component version number.

Help Help - Open this help page.

Search In OP Searchinop - Operator to search inside. All children of components will be searched recursively.

Search String Searchstring - The string to search for.

Replace String Replacestring - The string to replace searched string with.

Go Go - Perform the chosen operation.

Operation Operation - Choose Search Only or Search and Replace.

Open Result Table Openresulttable - Open a view of the search result table, which is also available through the Component's DAT output.

Clear Results Before Search Clearresultsbeforesearch - When on, clear the result table automatically before searching.

Clear Result Table Clearresulttable - Clear all search results from the result table.

Search OP Names Searchopnames - Search operator names.

Search Par Page Names Searchparpagenames - Search parameter page names.

Search Par Names/Labels Searchparnameslabels - Seach parameter names and labels.

Search DAT Text Searchdattext - Search text in editable DATs.

Search Par Data Searchpardata - Search parameter values and expressions.

Search Menu Items Searchmenuitems - Search parameter menu items (names and labels).

Search Field Text Searchfieldtext - Search the panel.field member of fieldCOMPs.

Case Sensitive Casesensitive - Case sensitive search.

Whole Words Wholewords - Look for search string only when it is not part of a larger word. Any non alpha-numeric characters are considered word boundaries.

Example: Searching for 'par' with Whole Words on will find me.par.limit but will not find parent

Regular Expressions Regularexpressions - When on, search string will be processed as a regular expression.

First N Matches Firstnmatches - Stop matching after finding the string in a given number of Operators.

N N - The number of matches to stop after.


Input 1 Search OP 'path' table: A table of OP paths to be searched. Must have a column with header: "path". Note that these OPs' children will not be searched. To search an OP's children use the Search OP parameter.

Input 2 'search' 'replace' table: A table of search and replace strings. Must have a column with header: "search" and a column with header: "replace".


Output1 Results: a list of results from the last operation.

Regular Expressions[edit]

This component gives you the option of using regular expressions, a powerful system used for string search and replace. An internet search will return many other regular expression resources besides those below.

Regular Expression Examples[edit]

These are very simple examples of things you can do with regular expressions. See full documentation for more.

  • par. → par followed by any character: pars, par1, parm
  • par... → par followed by any three characters: parent, par123
  • par\. → par followed by the '.' character: par. ONLY
  • par.* → par followed by any number (including 0) of any character: parent, parsimonious, par1, parm, par
  • par\b → par followed by any word boundary, which amounts to anything that ends with "par": par, ropar, 12par,
  • par1* → par followed by any number (including 0) of the character "1": par, par1, par1111
  • par1+ → par followed by any number (excluding 0) of the character "1": par1, par1111
  • par[a-e] → par followed by a letter "a" through "e": para, pard, pare
  • par[^a-e] → par followed by any character that is not the letters "a" through "e": parh, par1, par]
  • par[a-e]* → par followed by any number of instances of the letters "a" through "e": paraaaa, par, pardae
  • par[a-eX]* → par followed by any number of instances of the letters "a" through "e" or 'X': paraeXa, parX, par
  • par\d* → par followed by any number of digits: par, par58123, par0
  • par\d\d* → par followed by at least one digits: par58123, par0
  • par\w → par followed by any word character: par1, para

Regular Expression Escape Sequences[edit]

There are a number of useful regular expression escape sequences (starting with backslash character). See full documentation for more.

  • \d: a digit (0-9)
  • \s: a whitespace character
  • \S: a non-whitespace character
  • \w: a "word" character (a-z, A-Z, 0-9, and _)
  • \W: a non-"word" character (not a-z, A-Z, 0-9, or _)

Replacements in Regular Expressions[edit]

Replacements are also extremely powerful in Regular Expressions, using a simple grouping system. Use parenthesis to separate any number of regular expressions, then in the replacement string, reference those groups using \g<#> with # being the group number. See full documentation for more info.


  • Search: dog(\d) Replace: god\g<1> → dog3 becomes god3, dog0 becomes god0 etc.
  • Search: (dog|god)(\d) Replace: \g<2>\g<1> → dog3 becomes 3dog, god0 becomes 0god etc. Note: the | character is an "or" in the group.

Palette • Palette:arcBallCamera • Palette:arcBallGeometry • Palette:audioAnalysis • Palette:audioSet • Palette:battery • Palette:blendModes • Palette:bloom • Palette:cameraBrowser • Palette:camSchnappr • Palette:changeColor • Palette:changeToColor • Palette:checker • Palette:chromaKey • Palette:colorThreshold • Palette:compareComp • Palette:convolve • Palette:cornerPinSOP • Palette:customAttributes • Palette:dent • Palette:depthExtract • Palette:dilate • Palette:equalizer • Palette:feedback • Palette:feedbackEdge • Palette:firmata • Palette:geoPanel • Palette:gestureCapture • Palette:graphPlot • Palette:histogram • Palette:hsvBlur • Palette:imageSearch • Palette:julia • Palette:kantanMapper • Palette:kinectCalibration • Palette:kinectPointcloud • Palette:leapPaint • Palette:lightTunnel • Palette:mandelbrot • Palette:mesh • Palette:monochrome • Palette:motionSense • Palette:moviePlayer • Palette:multiLevel • Palette:multiMix • Palette:noise • Palette:onScreenKeyboard • Palette:opticalFlow • Palette:particlesGpu • Palette:pixelate • Palette:pixelRelocator • Palette:pointGenerator • Palette:pointillize • Palette:pointMerge • Palette:pointRender • Palette:pointRepack • Palette:pointTransform • Palette:pointWeight • Palette:popDialog • Palette:probe • Palette:projectorBlend • Palette:pushPins • Palette:puzzle • Palette:radialBlur • Palette:remotePanel • Palette:rgbaBlur • Palette:rgbaDelay • Palette:rgbContrast • Palette:search • Palette:searchReplace • Palette:sharpen • Palette:softenAlpha • Palette:solarize • Palette:sopRender • Palette:stitcher • Palette:stoner • Palette:superFormula • Palette:sweetSpotPreviz • Palette:TDVR • Palette:transitMap • Palette:twirl • Palette:vectorScope • Palette:virtualFile • Palette:waveformMonitor • Palette:webBrowser • Palette:xyScope

An Operator Family that contains its own Network inside. There are twelve 3D Object Component and eight 2D Panel Component types. See also Network Path.

Any of the procedural data operators. OPs do all the work in TouchDesigner. They "cook" and output data to other OPs, which ultimately result in new images, data and audio being generated. See Node.

An Operator Family that manipulates text strings: multi-line text or tables. Multi-line text is often a command Script, but can be any multi-line text. Tables are rows and columns of cells, each containing a text string.

A text string that contains data (string, float, list, boolean, etc.) and operators (+ * < etc) that are evaluated by the node's language (python or Tscript) and returns a string, float list or boolean, etc. Expressions are used in parameters, DATs and in scripts.

A built-in panel in TouchDesigner that contains a library of components and media that can be dragged-dropped into a TouchDesigner network.