Grooper Help - Version 25.0
25.0.0017 2,127
  • Overview
  • Help Status

Variable Provider

Grooper Object Grooper.Core

Represents a provider of built-in variables for use in regular expressions within Text Match extractors.

Remarks

Variable Providers supply a set of built-in, culture-sensitive variables that can be referenced in regular expressions for Text Match extractors. These variables allow you to create flexible and maintainable patterns that adapt to different languages, regions, and formatting conventions.

Purpose

The primary role of a Variable Provider is to expose named variables—such as @DateFormat, @CurrencySymbol, @DecimalSeparator, and @ThousandsSeparator—which represent values that may change depending on the user's culture or environment. These variables are automatically merged into regular expressions by Grooper when extracting data.

How Variables Are Used

When configuring a Text Match extractor, you can reference a variable by prefixing its name with @. For example:

(?<Amount>@CurrencySymbol\s*\d+(?:@DecimalSeparator\d{2})?)

In this example, @CurrencySymbol and @DecimalSeparator are replaced with culture-appropriate values (such as $ and . for en-US, or and , for de-DE).

Culture Sensitivity

Many built-in variables are sensitive to the current Culture Data, allowing extractors to work correctly across different locales. For instance:

  • @DateFormat: The date format string for the current culture (e.g., MM/dd/yyyy).
  • @CurrencySymbol: The currency symbol (e.g., $, , £).
  • @DecimalSeparator: The character used for decimal separation (e.g., ., ,).
  • @ThousandsSeparator: The character used for thousands separation (e.g., ,, .).

How Variables Are Merged

When a Text Match extractor is executed, Grooper scans the regular expression for variable references using the syntax @VariableName. Each reference is replaced with the corresponding value provided by the Variable Provider, ensuring the pattern matches data formatted according to the current culture.

Best Practices

  • Use built-in variable names to make your regular expressions more readable and adaptable.
  • Test extractors with sample data from different cultures to ensure correct variable resolution.
  • Avoid hard-coding culture-specific values; use variables instead for portability.
  • Review the available variables in your environment to take full advantage of built-in support.

Additional Information

For more details on available variables and how they are merged, see the documentation for Text Match extractors and review the implementation in EnvironmentOptions.cs.

Derived Types

There are 26 implementations of Variable Provider.

Alpha Provider Defines a character set which includes all Latin letters, plus all decimal digits which look like letters. ('A-Za-z013568')
Currency Decimal Digits Inserts the number of digits to the right of the decimal point in the language of the current document.
Currency Decimal Separators For the language of the current document, returns a character set including all possible separators between the whole and fractional part of a currency value.
Currency Group Digits Inserts the number of digits in each group of digits for the language of the current document.
Currency Group Separators For the language of the current document, returns a character set including all possible separators between digit groups in a currency value.
Currency Labels Inserts a pipe-delimited list all possible currency labels for the culture of the current document.
Currency Symbols Inserts a character set containing all single-character currency symbols for the culture of the current document.
Day Names Inserts a pipe-delimited list of day names in the language of the current document.
Day Names Abbreviated Inserts a pipe-delimited list of abbreviated day names in the language of the current document.
Day Names Shortest Inserts a pipe-delimited list of the shortest possible abbreviated day names in the language of the current document.
Digits Inserts a character set containing decimal digits in the language of the current document.
Expression Lexicon Provider Represents set of lexicons which define merge variables in the form of key-value pairs.
Extractor Variable Provider When editing the 'Pattern' property of Pattern-Based collaction, exposes one variable for each extractor of the host Data Type.
Field Value List Provider Returns a list of values for the field, in cases where the field has a value list defined.
Field Variable Defines a variable to merge in the value of the Data Field specified in the Field property of Field Match.
Group Vocabulary Provider Inserts a pipe-delimited list containing all vocabulary entries for a specific group.
Letters Inserts a character set containing all letters in the language of the current document.
Letters Lower Inserts a character set containing all lower case letters in the language of the current document.
Letters Upper Inserts a character set containing all upper case letters in the language of the current document.
Month Names Inserts a pipe-delimited list of month names in the language of the current document.
Month Names Abbreviated Inserts a pipe-delimited list of abbreviated month names in the language of the current document.
Month Names Genetive Inserts a pipe-delimited list of genetive month names in the language of the current document.
Number Names Provider Returns a pipe-delimited list of number names. (English only)
Number Provider Defines a character set which includes all digits, plus all Latin alpha characters which look like digits. ('0-9IilOoGgSsBUuD')
Referenced Lexicon Provider Represents Lexicons that define merge variables which expand to the list of values in each Lexicon.
Vocabulary Inserts a pipe-delimited list containing all vocabulary entries.
Notification