Skip to content

How To Create Code Expressions For Synonyms

The Code Editor is where you create and manage code expressions. Code expressions are used to match verbatim responses. This how-to guide will show you how to create code expressions for synonyms of that fall under one Code. First we'll cover an introduction to the Expression syntax.

Expression Language

The Expression field in the Code Editor uses a syntax called Regular Expressions to match one or more words or phrases in verbatims. The "Or" syntax in Regular Expressions is commonly used to match variations of text and synomyms in verbatims by listing each variation separated by a pipe character |.

For example to match the words "impressed", "satisfied", and "happy" in a verbatim, the expression would be:

impressed|satisfied|happy.

Words and Phrases

You can include not only single words but expressions or phases in the expression field. For example, to match "very impressed", "very satisfied", and "very happy" the expression would be:

very impressed|very satisfied|very happy.

Adding Words of Phrases To the Code Expression

To add words or phrases to the expression, follow these steps:

  1. Open the Code Editor for the Code you want to add synonyms to.
  2. For each word or phrase you want to add, add a pipe character | to the end of the current expression, then the word or phrase you want to add.
  3. Once all the words or phrases are added, review that there is exactly one pipe character | between each word or phrase and none at the beginning or end of the expression.
  4. Click Save Code to save the changes.

Code Editor Expression Field

See Responses Matching The Code Expression

Once the Code Expression is saved, you can see the responses that match the expression by right-clicking on the Code in the Codeframe panel and click Find verbatims containing this code Expression. This will filter the Responses panel to the expression matches.

Apply Code To All Matching Responses

If you want to apply the code to the matching responses, see the How To guide Apply Expression Matches.