Hyperlinkv0.8.0-beta.28

String

String.matchAllconsteffect/String.ts:727
(regExp: RegExp): (self: string) => IterableIterator<RegExpMatchArray>

Returns an iterator over all regular expression matches in the string using native String.prototype.matchAll semantics.

Example (Iterating regular expression matches)

import { pipe, String } from "effect"

const matches = pipe("hello world", String.matchAll(/l/g))
console.log(
  Array.from(matches, (match) => `${match[0]}@${match.index}`).join(", ")
) // "l@2, l@3, l@9"
searching
Source effect/String.ts:7271 lines
export const matchAll = (regExp: RegExp) => (self: string): IterableIterator<RegExpMatchArray> => self.matchAll(regExp)