@gruhn/regex-utils
    Preparing search index...

    Function and

    • Constructs a regex that matches the intersection of all input regex. This operator has no analog in standard regular expressions, so the return type is always an ExtRegex.

      NOTE: This is just a cheap constructor. There is no heavy computation until you call toStdRegex.

      Parameters

      Returns ExtRegex

      import { and, parse } from '@gruhn/regex-utils/low-level-api'

      const passwordRegex = and(
      parse(/.{12,}/), // 12 letters or more
      parse(/[0-9]/), // at least one number
      parse(/[A-Z]/), // at least one upper case letter
      parse(/[a-z]/), // at least one lower case letter
      )