Palette:searchReplace

From Derivative
Revision as of 21:03, 9 September 2019 by Ivan (talk | contribs)
Jump to navigation Jump to search

Summary[edit]

The searchReplace Component lets you search and (optionally) replace text in an operator or network.

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

Parameters[edit]

Search/Replace[edit]

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).

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.

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.

Examples[edit]

  • 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.

TouchDesigner Build:

Palette
Palette • Palette/Mapping/kantanMapper • Palette:arcBallCamera • Palette:arcBallGeometry • Palette:audioAnalysis • Palette:audioSet • Palette:battery • Palette:blendModes • Palette:bloom • Palette:camera • Palette:cameraBrowser • Palette:camSchnappr • Palette:changeColor • Palette:changeToColor • Palette:checker • Palette:chromaKey • Palette:colorThreshold • Palette:compareComp • Palette:convolve • Palette:cornerPinSOP • Palette:cppParsTemplateGen • Palette:customAttributes • Palette:debugControl • 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:moviePlaylist • 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:quadReproject • Palette:radialBlur • Palette:remotePanel • Palette:rgbaBlur • Palette:rgbaDelay • Palette:rgbContrast • Palette:sceneChanger • Palette:search • Palette:searchReplace • Palette:sharpen • Palette:softenAlpha • Palette:solarize • Palette:sopRender • Palette:splitter • Palette:stitcher • Palette:stoner • Palette:superFormula • Palette:sweetSpot • Palette:sweetSpotPreviz • Palette:TDVR • Palette:transitMap • Palette:twirl • Palette:vectorScope • Palette:virtualFile • Palette:waveformMonitor • Palette:webBrowser • Palette:webSvg • Palette:xyScope