tsbase
    Preparing search index...

    Class Regex

    Regular Expressions and Utilities

    Index

    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 = ...

    Matches: whatever@somewhere.museum | foreignchars@myforeigncharsdomain.nu | me+mysomething@mydomain.com

    Non-Matches: a@b.c | me@.my.com | a@b.comFOREIGNCHAR

    NonAlphaNumeric: RegExp = ...
    Uri: 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

    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: undefined | null | RegExpExecArray, currentValue: T) => void

      Returns T