import { string } from "https://deno.land/x/fun@v2.0.0/mod.ts";
const { match } = string;
Create a function that returns an Option. This is a curried form of RegExp.match.
Examples
Example 1
Example 1
import { match } from "./string.ts";
const words = match(/\w+/g);
const result1 = words("Hello World"); // Some(["Hello", "World"])
const result2 = words(""); // None
const result3 = words("1234"); // Some(["1234"])