DesignExamples of Character-Level Formatting

The following are some examples of configuring character-level formatting.

Important! Patterns for character-level formatting and for values returned from data map entries are governed by the Java syntax for regular expressions.

Escape sequences are required for the following characters. Precede the character with a double backslash.
< > ( ) [ ] { } | ^ - = + * $ ! ? . \

By default, literal text within a pattern is case sensitive. You can make a pattern case insensitive by beginning it with the special construct (?i). If you configure both patterns and ranges in a Character-Level format source, ranges are resolved before patterns.

For more information about Java syntax for regular expressions, see "Scripting, Java, and XML" in External Links.

Tip: You can include multiple styles and effects in each format source, and you can apply multiple format sources to each text field. Also, you can apply a format source to multiple text fields.

Example 1: Make all instances of an allergen name bold (case sensitivity)

You want to all instances of the allergen name Peanuts to be bold, regardless of case. You can accomplish this by using a Character-Level format source that you create in Label Design Label Design.

  1. When configuring the format source, in the Patterns panel click Add Add.
  2. For Pattern/Regular Expression, enter (?i)(peanuts).
  3. Click the cell in the Style/Effect column and select Bold.
  4. Click OK.
  5. From the Format Sources box, drag and drop the format source (identified by the name that you entered as the Format Name) onto each a Fixed Text or Variable Text field in the Label view in which the product name may appear.

Example 2: Apply special formatting to the first character (matching by range)

You want to format the first character in a text field as bold, 16-point Letter Gothic text. You can accomplish this by using a Character-Level format source that you create in Label Design Label Design.

  1. When configuring the format source, in the Ranges panel click Add Add.
  2. For Start, enter 1, and for End enter 1.
  3. Click the cell in the Style/Effect column and select Bold.
  4. Add another item with the same range, but for Style/Effect select Font and for Value enter Letter Gothic.
  5. Add another item with the same range, but for Style/Effect select Font Size and enter 16.
  6. Click OK.
  7. From the Format Sources box, drag and drop the format source (identified by the name that you entered as the Format Name) onto each a Fixed Text or Variable Text field in the Label view to which you want to apply this formatting.