Text Capture Settings JSON Structure

The following data fields can be set in the JSON used to initialize TextCaptureSettings.

Key

Mandatory

Type

Description

regex

true

String

Regular expression for filtering the recognized characters as a ECMAScript regular expressions pattern. Text that does not match the regular expression is ignored. The default value is “[\s\S]*” (matches everything). Setting this property to an empty string restores the default value.

characterWhitelist

false

String

Whitelist of recognizable characters. If the white list is provided, a recognition result will never contain characters that are not contained in it. By default there is no white list and all characters will be recognized.

Note

Using a regex with a capture group will make TextCapture return only the text matching the capture group. To return the full text matching the regex, use a non capturing group.

(?: foo)

Example

The following JSON can be used for capturing price labels.

{
  "regex": "\\s*\\d+.\\d{2}\\s*",
  "characterWhitelist": ""
}