Class Regex

Regular Expressions and Utilities

Constructors

Properties

AnyString: RegExp = ...
CreditCard: RegExp = ...

Matches: 1234-1234-1234-1234 | 1234 1234 1234 1234 | 1234123412341234

Non-Matches: Visa | 1234 | 123-1234-12345

CsvData: RegExp = ...
Email: RegExp = ...
NonAlphaNumeric: RegExp = ...
USCurrency: RegExp = ...

Matches: $3,023,123.34 | 9,876,453 | 123456.78

Non-Matches: 4,33,234.34 | $1.234 | abc

USPhoneNumber: RegExp = ...

Matches: (111) 222-3333 | 1112223333 | 111-222-3333

Non-Matches: 11122223333 | 11112223333 | 11122233333

USPostalCode: RegExp = ...

Matches: 14467 | 144679554 | 14467-9554

Non-Matches: 14467 955 | 14467- | 1446-9554

Uri: RegExp = ...
WhiteSpace: RegExp = ...
XmlTag: RegExp = ...

Methods

  • Executes the given RegExp on a string returning the final aggregated value after running the aggregator across all matches.

    Type Parameters

    • T

    Parameters

    • regex: RegExp
    • str: string
    • initialValue: T
    • aggregator: ((match, currentValue) => void)
        • (match, currentValue): void
        • Parameters

          • match: undefined | null | RegExpExecArray
          • currentValue: T

          Returns void

    Returns T

Generated using TypeDoc