Grooper Help - Version 25.0
25.0.0032 2,215

Custom

String Grooper.Core

Defines a custom value type, along with the logic for parsing and formatting values.

Remarks

The Storage Type Custom class enables advanced extraction, validation, and formatting of text values that do not conform to standard data types.
It is designed for scenarios where data must be parsed from complex or non-standard formats, such as codes, identifiers, or structured strings.

Overview

  • Allows you to define a custom regular expression to extract and validate input values.
  • Supports named groups in the regular expression for granular extraction and flexible output formatting.
  • Enables transformation of input data into normalized or user-defined output formats using templates.
  • Useful for capturing data such as part numbers, invoice codes, custom identifiers, or any structured text.

Key Features

  • Custom Parsing:: Use the 'Parse Pattern' property to specify a regular expression that defines valid input.
    Only values matching this pattern are accepted.
  • Named Group Extraction:: Define named groups in your regular expression (e.g., (?<GroupName>...)) to extract specific segments of the input.
    These groups can be referenced in the output format.
  • Flexible Output Formatting:: The 'Custom Format' property allows you to construct output values using named groups from the parse pattern.
    For example, you can reformat "INV-1234" as "Invoice: 1234" by referencing {Id} in the format string.
  • Configurable Regex Options:: The 'Options' property lets you control case sensitivity, multiline behavior, and other regular expression settings.
  • User Guidance:: The 'Type Name' and 'Hint' properties provide user-friendly names and input instructions, improving the configuration and validation experience.

Example

Suppose you want users to enter codes in the format ABC-1234, ABC:1234, or ABC1234, and you want to standardize the output to ABC-1234.

Parse Pattern:   (?<Prefix>[A-Z]+)[:-]?(?<Id>\d+)
Custom Format:   {Prefix}-{Id}
Input:           ABC1234 
Output:          ABC-1234 

Considerations

  • Ensure your regular expression matches the full expected input to avoid partial or invalid matches.
  • Use descriptive group names to make output formatting clear and maintainable.
  • Providing a helpful 'Hint' can reduce user errors and improve the configuration experience.
  • The 'Type Name' must start with a letter or underscore and contain only letters, numbers, and underscores.

Properties

NameTypeDescription
General
Range

Used By

Notification