• Preparing search index...
  • The search index is not available
Documentation
  • Documentation
  • @laserfiche/lf-js-utils
  • LfMetadataValidationUtils
  • formatTextConstraint

Function formatTextConstraint

  • formatTextConstraint(textConstraint: string): string

    Given a string representing a laserfiche text constraint, returns the corresponding regex as string

    Parameters

    • textConstraint: string

      // e.g. '[[:alnum:]][[:alnum:]][[:alnum:]]'. Please reference the laserfiche documentation for more information: https://www.laserfiche.com/support/webhelp/Laserfiche/10/en-US/administration/#../Subsystems/LFAdmin/Content/Restricting_Field_Data_to_a_Specific_Format.htm?Highlight=constraintformat

    Returns string

    the corresponding regex

    Example

    const newContraint = formatTextConstraint('\[\[:alnum:\]\]\[\[:alnum:\]\]\[\[:alnum:\]\]');
    // newContraint -> ^\[0-9A-Za-z\]\[0-9A-Za-z\]\[0-9A-Za-z\]\$
    const regex = new RegExp(newContraint);
    regex.test('ab1'); // true
    regex.test('a'); // false
    • Defined in validation-utils/text-validation-utils.ts:91

Settings

Member Visibility
Documentation
  • Loading...

Generated using TypeDoc