User Tools

Site Tools


REPLACE

Guide Section: Processing Object Data | EASAP Tree: DATA PROCESSINGSCALAR


REPLACE locates the Find Text: string in the string specified in Value: and replaces that text with the text in the Replace With: parameter.

REPLACE can be useful when arbitrary input text needs to be escaped, for example when rendering characters such as < in HTML, or to allow in a database query. Regular Expressions may also be turned on for use during searching.

REPLACE
Essential Parameters:
Value:Drop down list to select a string, SCALAR DORs only
Find Text:The text to match in Value:, Regular Expressions allowed.
Replace With:The text to replace the matched text with
Replacement Mode:Select operation (ALL, FIRST)
Optional Parameters:
Delimiter:Character to delimit object references in Value: / Find Text: / Replace With:. default→%
Allow Regular Expressions:default→FALSE, TRUE

REPLACE Examples

Examples for a REPLACE named replace1:

Example One

  • textbox1→user’s database input
  • Value: %textbox1%
  • Find Text:
  • Replace With: ’’
  • Replacement Mode: ALL
  • replace1→user’’s database input

Example Two

  • Value: dir1\dir2\file1.txt
  • Find Text: \
  • Replace With: /
  • Replacement Mode: ALL
  • replace1→dir1/dir2/file1.txt

Example Three (Regular Expression)

  • Value: first, last
  • Find Text: ([\w]+), ([\w]+)
  • Replace With: $2, $1
  • Replacement Mode: ALL
  • Allow Regular Expressions: TRUE
  • replace1→last, first

Example Four (Regular Expression)

  • current_year→2000
  • Value: Report for 1998
  • Find Text: [\d]{4}
  • Replace With: %current_year%
  • Replacement Mode: ALL
  • Allow Regular Expressions: TRUE
  • replace1→Report for 2000