Skip to content

chore(deps): bump wasm-bindgen-test from 0.3.50 to 0.3.80 - #148

Open
dependabot[bot] wants to merge 1 commit into
masterfrom
dependabot/cargo/wasm-bindgen-test-0.3.80
Open

dependabot[bot] wants to merge 1 commit into
masterfrom
dependabot/cargo/wasm-bindgen-test-0.3.80

Conversation

@dependabot

@dependabot dependabot Bot commented on behalf of github Nov 2, 2026

Copy link
Copy Markdown
Contributor

Bumps wasm-bindgen-test from 0.3.50 to 0.3.80.

Commits

Dependabot compatibility score

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


Dependabot commands and options

You can trigger Dependabot actions by commenting on this PR:

  • @dependabot rebase will rebase this PR
  • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
  • @dependabot show <dependency name> ignore conditions will show all of the ignore conditions of the specified dependency
  • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)

Bumps [wasm-bindgen-test](https://github.com/wasm-bindgen/wasm-bindgen) from 0.3.50 to 0.3.80.
- [Release notes](https://github.com/wasm-bindgen/wasm-bindgen/releases)
- [Changelog](https://github.com/wasm-bindgen/wasm-bindgen/blob/main/CHANGELOG.md)
- [Commits](https://github.com/wasm-bindgen/wasm-bindgen/commits)

---
updated-dependencies:
- dependency-name: wasm-bindgen-test
  dependency-version: 0.3.80
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
@dependabot dependabot Bot added dependencies Pull requests that update a dependency file rust Pull requests that update rust code labels Nov 2, 2026
@github-actions

github-actions Bot commented Nov 2, 2026

Copy link
Copy Markdown

⏱️ Benchmark results

Comparing head 63ddfb2 against base rregex@1.13.5 (npm latest) on Node v26.13.0, Chrome 156 and Firefox 158 (5 rounds × 250 ms per case). Changes within ±10% are treated as noise.

Warning

1 possible performance regression(s) detected:

  • uri: replaceAll on Firefox 158: +17.1%
Benchmark Node v26.13.0
Δ time
Chrome 156
Δ time
Firefox 158
Δ time
email: new ➖ -1.8% ➖ -3.3% ➖ -0.8%
email: isMatch ➖ -0.8% ➖ -0.1% ➖ 0.0%
email: find ➖ +0.2% ➖ +0.2% ➖ 0.0%
email: findAll ➖ -1.4% ➖ -0.4% ➖ +0.4%
email: replaceAll ✅ -11.0% ➖ +0.6% ➖ -0.8%
ip: new ➖ -1.2% ➖ -1.4% ➖ -0.4%
ip: isMatch ➖ -1.0% ➖ +0.4% ➖ 0.0%
ip: find ➖ +3.7% ➖ +0.8% ➖ +0.1%
ip: findAll ➖ +4.3% ➖ +1.1% ➖ -0.4%
ip: replaceAll ➖ -2.5% ➖ -1.1% ➖ -0.4%
uri: new ➖ -1.5% ➖ +0.8% ➖ -0.4%
uri: isMatch ➖ -0.9% ➖ +0.2% ➖ +2.8%
uri: find ➖ -1.3% ➖ -0.3% ➖ -1.3%
uri: findAll ➖ -0.4% ➖ -0.4% ➖ -4.8%
uri: replaceAll ➖ -6.9% ➖ -0.1% ⚠️ +17.1%
set: new ➖ -2.9% ➖ -1.4% ➖ +0.8%
set: matches ➖ -0.3% ➖ -0.2% ➖ -0.8%
Node v26.13.0: times (AMD EPYC 9V45 96-Core Processor)
Benchmark base head RegExp Δ time ±
➖ email: new 646.63 µs (1,546 ops/s) 642.33 µs (1,557 ops/s) — -1.8% 3.2%
➖ email: isMatch 52.85 µs (18,921 ops/s) 52.17 µs (19,170 ops/s) 194.37 µs (5,145 ops/s) -0.8% 0.4%
➖ email: find 53.67 µs (18,634 ops/s) 53.68 µs (18,630 ops/s) 194.18 µs (5,150 ops/s) +0.2% 0.3%
➖ email: findAll 116.27 µs (8,600 ops/s) 116.25 µs (8,602 ops/s) 3.79 ms (264 ops/s) -1.4% 0.8%
✅ email: replaceAll 209.60 µs (4,771 ops/s) 184.58 µs (5,418 ops/s) 3.75 ms (266 ops/s) -11.0% 1.6%
➖ ip: new 103.09 µs (9,701 ops/s) 105.24 µs (9,502 ops/s) — -1.2% 1.3%
➖ ip: isMatch 343.61 µs (2,910 ops/s) 340.93 µs (2,933 ops/s) 48.63 µs (20,563 ops/s) -1.0% 0.6%
➖ ip: find 309.35 µs (3,233 ops/s) 319.14 µs (3,133 ops/s) 47.67 µs (20,977 ops/s) +3.7% 2.4%
➖ ip: findAll 310.07 µs (3,225 ops/s) 321.38 µs (3,112 ops/s) 47.92 µs (20,868 ops/s) +4.3% 2.4%
➖ ip: replaceAll 414.95 µs (2,410 ops/s) 428.57 µs (2,333 ops/s) 47.40 µs (21,096 ops/s) -2.5% 3.6%
➖ uri: new 323.83 µs (3,088 ops/s) 317.77 µs (3,147 ops/s) — -1.5% 1.7%
➖ uri: isMatch 49.66 µs (20,137 ops/s) 49.99 µs (20,003 ops/s) 298 ns (3,354,700 ops/s) -0.9% 1.6%
➖ uri: find 50.35 µs (19,860 ops/s) 50.04 µs (19,982 ops/s) 313 ns (3,195,860 ops/s) -1.3% 1.9%
➖ uri: findAll 297.99 µs (3,356 ops/s) 296.09 µs (3,377 ops/s) 3.22 ms (310 ops/s) -0.4% 1.5%
➖ uri: replaceAll 331.14 µs (3,020 ops/s) 303.73 µs (3,292 ops/s) 3.44 ms (291 ops/s) -6.9% 1.0%
➖ set: new 871.23 µs (1,148 ops/s) 836.17 µs (1,196 ops/s) — -2.9% 1.1%
➖ set: matches 1.40 ms (712 ops/s) 1.40 ms (714 ops/s) 255.21 µs (3,918 ops/s) -0.3% 0.3%
Chrome 156: times (AMD EPYC 9V74 80-Core Processor)
Benchmark base head RegExp Δ time ±
➖ email: new 883.80 µs (1,131 ops/s) 854.05 µs (1,171 ops/s) — -3.3% 3.9%
➖ email: isMatch 1.44 ms (692 ops/s) 1.44 ms (694 ops/s) 39.34 µs (25,417 ops/s) -0.1% 4.4%
➖ email: find 1.44 ms (692 ops/s) 1.45 ms (690 ops/s) 39.55 µs (25,286 ops/s) +0.2% 1.3%
➖ email: findAll 1.54 ms (651 ops/s) 1.53 ms (653 ops/s) 1.88 ms (531 ops/s) -0.4% 1.2%
➖ email: replaceAll 2.99 ms (335 ops/s) 3.00 ms (333 ops/s) 1.89 ms (530 ops/s) +0.6% 2.2%
➖ ip: new 132.47 µs (7,549 ops/s) 131.25 µs (7,619 ops/s) — -1.4% 10.4%
➖ ip: isMatch 1.89 ms (529 ops/s) 1.90 ms (527 ops/s) 46.69 µs (21,418 ops/s) +0.4% 4.6%
➖ ip: find 1.90 ms (526 ops/s) 1.92 ms (522 ops/s) 47.34 µs (21,124 ops/s) +0.8% 1.9%
➖ ip: findAll 1.91 ms (525 ops/s) 1.92 ms (522 ops/s) 47.21 µs (21,182 ops/s) +1.1% 4.6%
➖ ip: replaceAll 3.42 ms (292 ops/s) 3.41 ms (293 ops/s) 47.06 µs (21,249 ops/s) -1.1% 4.1%
➖ uri: new 434.55 µs (2,301 ops/s) 437.67 µs (2,285 ops/s) — +0.8% 2.8%
➖ uri: isMatch 1.43 ms (698 ops/s) 1.43 ms (700 ops/s) 111 ns (9,048,363 ops/s) +0.2% 2.8%
➖ uri: find 1.45 ms (689 ops/s) 1.44 ms (696 ops/s) 116 ns (8,616,287 ops/s) -0.3% 2.9%
➖ uri: findAll 1.89 ms (530 ops/s) 1.88 ms (532 ops/s) 1.62 ms (616 ops/s) -0.4% 0.8%
➖ uri: replaceAll 3.18 ms (314 ops/s) 3.19 ms (313 ops/s) 1.69 ms (591 ops/s) -0.1% 0.7%
➖ set: new 1.13 ms (883 ops/s) 1.12 ms (895 ops/s) — -1.4% 3.3%
➖ set: matches 3.17 ms (315 ops/s) 3.17 ms (316 ops/s) 91.42 µs (10,938 ops/s) -0.2% 0.5%
Firefox 158: times (AMD EPYC 7763 64-Core Processor)
Benchmark base head RegExp Δ time ±
➖ email: new 1.22 ms (822 ops/s) 1.20 ms (832 ops/s) — -0.8% 15.8%
➖ email: isMatch 163.41 µs (6,120 ops/s) 164.71 µs (6,071 ops/s) 69.75 µs (14,336 ops/s) 0.0% 8.3%
➖ email: find 168.88 µs (5,921 ops/s) 168.88 µs (5,921 ops/s) 70.87 µs (14,110 ops/s) 0.0% 3.5%
➖ email: findAll 293.98 µs (3,402 ops/s) 291.67 µs (3,429 ops/s) 1.97 ms (508 ops/s) +0.4% 6.9%
➖ email: replaceAll 1.02 ms (976 ops/s) 1.02 ms (984 ops/s) 1.99 ms (502 ops/s) -0.8% 4.7%
➖ ip: new 262.50 µs (3,810 ops/s) 258.20 µs (3,873 ops/s) — -0.4% 8.4%
➖ ip: isMatch 878.47 µs (1,138 ops/s) 875.00 µs (1,143 ops/s) 69.50 µs (14,388 ops/s) 0.0% 6.5%
➖ ip: find 896.43 µs (1,116 ops/s) 892.86 µs (1,120 ops/s) 69.63 µs (14,362 ops/s) +0.1% 6.2%
➖ ip: findAll 896.43 µs (1,116 ops/s) 892.86 µs (1,120 ops/s) 95.66 µs (10,454 ops/s) -0.4% 4.3%
➖ ip: replaceAll 1.89 ms (528 ops/s) 1.90 ms (526 ops/s) 69.75 µs (14,336 ops/s) -0.4% 29.4%
➖ uri: new 640.31 µs (1,562 ops/s) 637.76 µs (1,568 ops/s) — -0.4% 3.8%
➖ uri: isMatch 156.25 µs (6,400 ops/s) 158.13 µs (6,324 ops/s) 121 ns (8,256,504 ops/s) +2.8% 7.2%
➖ uri: find 160.71 µs (6,222 ops/s) 159.44 µs (6,272 ops/s) 141 ns (7,077,888 ops/s) -1.3% 4.1%
➖ uri: findAll 875.00 µs (1,143 ops/s) 828.95 µs (1,206 ops/s) 1.89 ms (530 ops/s) -4.8% 6.0%
⚠️ uri: replaceAll 1.29 ms (778 ops/s) 1.50 ms (667 ops/s) 1.88 ms (531 ops/s) +17.1% 27.3%
➖ set: new 1.56 ms (643 ops/s) 1.55 ms (643 ops/s) — +0.8% 6.1%
➖ set: matches 2.66 ms (376 ops/s) 2.64 ms (378 ops/s) 178.98 µs (5,587 ops/s) -0.8% 5.9%
Artifact base head Δ size
rregex.wasm 1193.3 KiB 1193.6 KiB +0.0%
Build step head
cargo build 5.32 s
wasm-bindgen 0.21 s
wasm-opt 1.74 s
tsdown 3.00 s
Total 8.53 s

Δ time is the median of the per-round head/base ratios (lower is better). RegExp is the time of the equivalent native RegExp call in the same runtime (new has no equivalent, RegExp compiles on first use). ± is the worst relative margin of error seen across rounds. The build time of cargo build depends on the state of the CI cache; wasm-opt and tsdown run in parallel, so the total is less than the sum. Shared CI runners are noisy: re-run the job before you act on a small regression.

Workflow run · updated for 63ddfb2

@github-actions

github-actions Bot commented Nov 2, 2026

Copy link
Copy Markdown

🧩 Public API changes

Comparing the type declarations and the package.json entry points of head 63ddfb2 against base rregex@1.13.5 (npm latest).

Important

The public API changes in 6 file(s). In the diffs, lines that start with + are added and lines that start with - are removed.

Changed: cf.d.mts, commonjs.d.cts, core.d.cts, core.d.mts, web.d.ts

217 line(s) added (+), 215 line(s) removed (-); line numbers of cf.d.mts

@@ -1,12 +1,5 @@
 /* tslint:disable */
 /* eslint-disable */
-/**
- * Escapes all regular expression meta characters in `text`.
- *
- * The string returned may be safely used as a literal in a regular
- * expression.
- */
-export declare function escape(text: string): string;
 /**
  * Represents a single match of a regex in a haystack.
  *
@@ -662,33 +655,13 @@ export type RRegexOptions = {
  */
 export declare class RRegex {
   free(): void;
+  [Symbol.dispose](): void;
   /**
-   * Returns the same as is_match, but starts the search at the given offset.
-   * The significance of the starting point is that it takes the surrounding
-   * context into consideration. For example, the `\A` anchor can only match
-   * when `start == 0`.
-   *
-   * @see https://docs.rs/regex/latest/regex/struct.Regex.html#method.is_match_at
-   * @param {string} text - The string against which to match the regular expression
-   * @param {number} start - Zero-based index at which to start matching
-   * @return {boolean}
-   */
-  isMatchAt(text: string, start: number): boolean;
-  /**
-   * Replaces all non-overlapping matches in `text` with the replacement
-   * provided. This is the same as calling `replacen` with `limit` set to
-   * `0`.
-   *
-   * See the documentation for `replace` for details on how to access
-   * capturing group matches in the replacement string.
+   * Returns a list of the capture names in this regex.
    *
-   * See the documentation for `replace` for details on how to access capturing group matches in the replacement string.
-   * @see https://docs.rs/regex/latest/regex/struct.Regex.html#method.replace_all
-   * @param {string} text - The string against which to match the regular expression
-   * @param {string} rep - It's a string, it will replace the substring matched by `pattern`.
-   * @returns {string}
+   * @see https://docs.rs/regex/latest/regex/struct.Regex.html#method.capture_names
    */
-  replaceAll(text: string, rep: string): string;
+  captureNames(): (string | null)[];
   /**
    * Returns a list with all the non-overlapping capture groups matched
    * in `text`. This is operationally the same as `findAll`, except it
@@ -755,66 +728,88 @@ export declare class RRegex {
    */
   capturesLength(): number;
   /**
-   * Returns a list of the capture names in this regex.
+   * Returns the capture groups corresponding to the leftmost-first
+   * match in `text`. Capture group `0` always corresponds to the entire
+   * match. If no match is found, then `undefined` is returned.
    *
-   * @see https://docs.rs/regex/latest/regex/struct.Regex.html#method.capture_names
-   */
-  captureNames(): (string | null)[];
-  /**
-   * Returns the end location of a match in the text given.
+   * You should only use `captures` if you need access to the location of
+   * capturing group matches. Otherwise, `find` is faster for discovering
+   * the location of the overall match.
    *
-   * This method may have the same performance characteristics as
-   * `isMatch`, except it provides an end location for a match. In
-   * particular, the location returned *may be shorter* than the proper end
-   * of the leftmost-first match that you would find via `Regex.find`.
+   * # Examples
    *
-   * Note that it is not guaranteed that this routine finds the shortest or
-   * "earliest" possible match. Instead, the main idea of this API is that
-   * it returns the offset at the point at which the internal regex engine
-   * has determined that a match has occurred. This may vary depending on
-   * which internal regex engine is used, and thus, the offset itself may
-   * change.
+   * Say you have some text with movie names and their release years,
+   * like "'Citizen Kane' (1941)". It'd be nice if we could search for text
+   * looking like that, while also extracting the movie name and its release
+   * year separately.
    *
-   * # Example
+   * ```typescript
+   * import { RRegex } from "rregex"
    *
-   * Typically, `a+` would match the entire first sequence of `a` in some
-   * text, but `shortest_match` can give up as soon as it sees the first
-   * `a`.
+   * const re = new RRegex("'([^']+)'\\s+\\((\\d{4})\)")
+   * const text = "Not my favorite movie: 'Citizen Kane' (1941)."
+   * const caps = re.captures(text)
+   * expect(caps.get[1].value).toBe("Citizen Kane")
+   * expect(caps.get[2].value).toBe("1941")
+   * expect(caps.get[0].value).toBe("'Citizen Kane' (1941)")
+   * ```
+   *
+   * Note that the full match is at capture group `0`. Each subsequent
+   * capture group is indexed by the order of its opening `(`.
+   *
+   * We can make this example a bit clearer by using *named* capture groups:
    *
    * ```typescript
    * import { RRegex } from "rregex"
    *
-   * const text = "aaaaa"
-   * const = new RRegex("a+").shortest_match(text)
-   * expect(pos).toBe(1)
+   * const re = new RRegex("'(?P<title>[^']+)'\\s+\\((?P<year>\\d{4})\)")
+   * const text = "Not my favorite movie: 'Citizen Kane' (1941)."
+   * const caps = re.captures(text)
+   * expect(caps.name["title"].value).toBe("Citizen Kane")
+   * expect(caps.name["year"].value).toBe("1941")
+   * expect(caps.get[0].value).toBe("'Citizen Kane' (1941)")
    * ```
    *
-   * @see https://docs.rs/regex/latest/regex/struct.Regex.html#method.shortest_match
+   * @see https://docs.rs/regex/latest/regex/struct.Regex.html#method.captures
    * @param {string} text - The string against which to match the regular expression
-   * @returns {number|undefined}
+   * @returns {Captures|undefined}
    */
-  shortestMatch(text: string): number | undefined;
+  captures(text: string): Captures | undefined;
   /**
-   * Returns the same as `shortest_match`, but starts the search at the
-   * given offset.
+   * Returns an array for each successive non-overlapping match in `text``,
+   * returning the start and end byte indices with respect to `text`.
    *
-   * The significance of the starting point is that it takes the surrounding
-   * context into consideration. For example, the `\A` anchor can only match
-   * when `start == 0`.
-   * @see https://docs.rs/regex/latest/regex/struct.Regex.html#method.shortest_match_at
+   * # Example
+   *
+   * Find the start and end location of every word with exactly 13 Unicode
+   * word characters:
+   *
+   * ```typescript
+   * import { RRegex } from "rregex"
+   *
+   * const text = "Retroactively relinquishing remunerations is reprehensible."
+   * const matches = new RRegex("\\b\\w{13}\\b").findAll(text)
+   * ```
+   *
+   * @see https://docs.rs/regex/latest/regex/struct.Regex.html#method.find_iter
    * @param {string} text - The string against which to match the regular expression
-   * @param {number} start - Zero-based index at which to start matching
-   * @returns {number|undefined}
+   * @returns {Match}
    */
-  shortestMatchAt(text: string, start: number): number | undefined;
+  findAll(text: string): Match[];
   /**
-   * Compiles a regular expression. Once compiled, it can be used repeatedly
-   * to search, split or replace text in a string.
+   * Returns the same as find, but starts the search at the given
+   * offset.
    *
-   * If an invalid expression is given, then an error is returned.
-   * Options only apply to this instance, see `RRegexOptions`.
+   * The significance of the starting point is that it takes the surrounding
+   * context into consideration. For example, the `\A` anchor can only
+   * match when `start == 0`.
+   *
+   * @see https://docs.rs/regex/latest/regex/struct.Regex.html#method.find_at
+   * @param {string} text - The string against which to match the regular expression
+   * @param {number} start - Zero-based index at which to start matching
+   * @returns {Match}
    */
-  constructor(re: string, options?: RRegexOptions | null);
+  findAt(text: string, start: number): Match | undefined;
   /**
    * Returns the start and end byte range of the leftmost-first match in
    * `text`. If no match exists, then `undefined` is returned.
@@ -843,74 +838,65 @@ export declare class RRegex {
    */
   find(text: string): Match | undefined;
   /**
-   * Returns an iterator of substrings of `text` delimited by a match of the
-   * regular expression. Namely, each element of the iterator corresponds to
-   * text that *isn't* matched by the regular expression.
-   *
-   * This method will *not* copy the text given.
-   *
-   * # Example
-   *
-   * To split a string delimited by arbitrary amounts of spaces or tabs:
-   *
-   * ```typescript
-   * import { RRegex } from "rregex"
-   *
-   * const re = new RRegex(r"[ \\t]+")
-   * const fields = re.split("a b \t  c\td    e")
-   * expect(fields).toEqual(["a", "b", "c", "d", "e"])
-   * ```
+   * Returns the same as is_match, but starts the search at the given offset.
+   * The significance of the starting point is that it takes the surrounding
+   * context into consideration. For example, the `\A` anchor can only match
+   * when `start == 0`.
    *
-   * @see https://docs.rs/regex/latest/regex/struct.Regex.html#method.split
+   * @see https://docs.rs/regex/latest/regex/struct.Regex.html#method.is_match_at
    * @param {string} text - The string against which to match the regular expression
-   * @returns {string[]}
+   * @param {number} start - Zero-based index at which to start matching
+   * @return {boolean}
    */
-  split(text: string): string[];
+  isMatchAt(text: string, start: number): boolean;
   /**
-   * Returns an iterator of at most `limit` substrings of `text` delimited
-   * by a match of the regular expression. (A `limit` of `0` will return no
-   * substrings.) Namely, each element of the iterator corresponds to text
-   * that *isn't* matched by the regular expression. The remainder of the
-   * string that is not split will be the last element in the iterator.
+   * Returns true if and only if there is a match for the regex in the
+   * string given.
    *
-   * This method will *not* copy the text given.
+   * It is recommended to use this method if all you need to do is test
+   * a match, since the underlying matching engine may be able to do less
+   * work.
    *
    * # Example
    *
-   * Get the first two words in some text:
+   * Test if some text contains at least one word with exactly 13
+   * Unicode word characters:
    *
    * ```typescript
    * import { RRegex } from "rregex"
    *
-   * const re = new RRegex(r"\\W+")
-   * const fields = re.splitn("Hey! How are you?", 3)
-   * expect(fields).toEqual(["Hey", "How", "are you?"])
+   * const text = "I categorically deny having triskaidekaphobia."
+   * expect(new RRegex("\\b\\w{13}\\b").is_match(text)).toBe(true)
    * ```
-   * @see https://docs.rs/regex/latest/regex/struct.Regex.html#method.splitn
+   *
+   * @see https://docs.rs/regex/latest/regex/struct.Regex.html#method.is_match
    * @param {string} text - The string against which to match the regular expression
-   * @param {number} limit - Max number result elements
-   * @returns {string[]}
+   * @return {boolean}
    */
-  splitn(text: string, limit: number): string[];
+  isMatch(text: string): boolean;
   /**
-   * Returns the regular expression into a high level intermediate
-   * representation.
+   * Compiles a regular expression. Once compiled, it can be used repeatedly
+   * to search, split or replace text in a string.
+   *
+   * If an invalid expression is given, then an error is returned.
+   * Options only apply to this instance, see `RRegexOptions`.
    */
-  syntax(): Hir;
+  constructor(re: string, options?: RRegexOptions | null);
   /**
-   * Returns the same as find, but starts the search at the given
-   * offset.
+   * Replaces all non-overlapping matches in `text` with the replacement
+   * provided. This is the same as calling `replacen` with `limit` set to
+   * `0`.
    *
-   * The significance of the starting point is that it takes the surrounding
-   * context into consideration. For example, the `\A` anchor can only
-   * match when `start == 0`.
+   * See the documentation for `replace` for details on how to access
+   * capturing group matches in the replacement string.
    *
-   * @see https://docs.rs/regex/latest/regex/struct.Regex.html#method.find_at
+   * See the documentation for `replace` for details on how to access capturing group matches in the replacement string.
+   * @see https://docs.rs/regex/latest/regex/struct.Regex.html#method.replace_all
    * @param {string} text - The string against which to match the regular expression
-   * @param {number} start - Zero-based index at which to start matching
-   * @returns {Match}
+   * @param {string} rep - It's a string, it will replace the substring matched by `pattern`.
+   * @returns {string}
    */
-  findAt(text: string, start: number): Match | undefined;
+  replaceAll(text: string, rep: string): string;
   /**
    * Replaces the leftmost-first match with the replacement provided.
    * The replacement can be a regular string (where `$N` and `$name` are
@@ -988,114 +974,122 @@ export declare class RRegex {
    */
   replace(text: string, rep: string): string;
   /**
-   * Returns the capture groups corresponding to the leftmost-first
-   * match in `text`. Capture group `0` always corresponds to the entire
-   * match. If no match is found, then `undefined` is returned.
+   * Replaces at most `limit` non-overlapping matches in `text` with the
+   * replacement provided. If `limit` is 0, then all non-overlapping matches
+   * are replaced.
    *
-   * You should only use `captures` if you need access to the location of
-   * capturing group matches. Otherwise, `find` is faster for discovering
-   * the location of the overall match.
+   * See the documentation for `replace` for details on how to access
+   * capturing group matches in the replacement string.
    *
-   * # Examples
+   * @see https://docs.rs/regex/latest/regex/struct.Regex.html#method.replacen
+   * @param {string} text - The string against which to match the regular expression
+   * @param {number} limit - Max number of replacement
+   * @param {string} rep - It's a string, it will replace the substring matched by `pattern`.
+   * @returns {string}
+   */
+  replacen(text: string, limit: number, rep: string): string;
+  /**
+   * Returns the same as `shortest_match`, but starts the search at the
+   * given offset.
    *
-   * Say you have some text with movie names and their release years,
-   * like "'Citizen Kane' (1941)". It'd be nice if we could search for text
-   * looking like that, while also extracting the movie name and its release
-   * year separately.
+   * The significance of the starting point is that it takes the surrounding
+   * context into consideration. For example, the `\A` anchor can only match
+   * when `start == 0`.
+   * @see https://docs.rs/regex/latest/regex/struct.Regex.html#method.shortest_match_at
+   * @param {string} text - The string against which to match the regular expression
+   * @param {number} start - Zero-based index at which to start matching
+   * @returns {number|undefined}
+   */
+  shortestMatchAt(text: string, start: number): number | undefined;
+  /**
+   * Returns the end location of a match in the text given.
    *
-   * ```typescript
-   * import { RRegex } from "rregex"
+   * This method may have the same performance characteristics as
+   * `isMatch`, except it provides an end location for a match. In
+   * particular, the location returned *may be shorter* than the proper end
+   * of the leftmost-first match that you would find via `Regex.find`.
    *
-   * const re = new RRegex("'([^']+)'\\s+\\((\\d{4})\)")
-   * const text = "Not my favorite movie: 'Citizen Kane' (1941)."
-   * const caps = re.captures(text)
-   * expect(caps.get[1].value).toBe("Citizen Kane")
-   * expect(caps.get[2].value).toBe("1941")
-   * expect(caps.get[0].value).toBe("'Citizen Kane' (1941)")
-   * ```
+   * Note that it is not guaranteed that this routine finds the shortest or
+   * "earliest" possible match. Instead, the main idea of this API is that
+   * it returns the offset at the point at which the internal regex engine
+   * has determined that a match has occurred. This may vary depending on
+   * which internal regex engine is used, and thus, the offset itself may
+   * change.
    *
-   * Note that the full match is at capture group `0`. Each subsequent
-   * capture group is indexed by the order of its opening `(`.
+   * # Example
    *
-   * We can make this example a bit clearer by using *named* capture groups:
+   * Typically, `a+` would match the entire first sequence of `a` in some
+   * text, but `shortest_match` can give up as soon as it sees the first
+   * `a`.
    *
    * ```typescript
    * import { RRegex } from "rregex"
    *
-   * const re = new RRegex("'(?P<title>[^']+)'\\s+\\((?P<year>\\d{4})\)")
-   * const text = "Not my favorite movie: 'Citizen Kane' (1941)."
-   * const caps = re.captures(text)
-   * expect(caps.name["title"].value).toBe("Citizen Kane")
-   * expect(caps.name["year"].value).toBe("1941")
-   * expect(caps.get[0].value).toBe("'Citizen Kane' (1941)")
+   * const text = "aaaaa"
+   * const = new RRegex("a+").shortest_match(text)
+   * expect(pos).toBe(1)
    * ```
    *
-   * @see https://docs.rs/regex/latest/regex/struct.Regex.html#method.captures
+   * @see https://docs.rs/regex/latest/regex/struct.Regex.html#method.shortest_match
    * @param {string} text - The string against which to match the regular expression
-   * @returns {Captures|undefined}
+   * @returns {number|undefined}
    */
-  captures(text: string): Captures | undefined;
+  shortestMatch(text: string): number | undefined;
   /**
-   * Returns an array for each successive non-overlapping match in `text``,
-   * returning the start and end byte indices with respect to `text`.
+   * Returns an iterator of substrings of `text` delimited by a match of the
+   * regular expression. Namely, each element of the iterator corresponds to
+   * text that *isn't* matched by the regular expression.
+   *
+   * This method will *not* copy the text given.
    *
    * # Example
    *
-   * Find the start and end location of every word with exactly 13 Unicode
-   * word characters:
+   * To split a string delimited by arbitrary amounts of spaces or tabs:
    *
    * ```typescript
    * import { RRegex } from "rregex"
    *
-   * const text = "Retroactively relinquishing remunerations is reprehensible."
-   * const matches = new RRegex("\\b\\w{13}\\b").findAll(text)
+   * const re = new RRegex(r"[ \\t]+")
+   * const fields = re.split("a b \t  c\td    e")
+   * expect(fields).toEqual(["a", "b", "c", "d", "e"])
    * ```
    *
-   * @see https://docs.rs/regex/latest/regex/struct.Regex.html#method.find_iter
+   * @see https://docs.rs/regex/latest/regex/struct.Regex.html#method.split
    * @param {string} text - The string against which to match the regular expression
-   * @returns {Match}
+   * @returns {string[]}
    */
-  findAll(text: string): Match[];
+  split(text: string): string[];
   /**
-   * Returns true if and only if there is a match for the regex in the
-   * string given.
+   * Returns an iterator of at most `limit` substrings of `text` delimited
+   * by a match of the regular expression. (A `limit` of `0` will return no
+   * substrings.) Namely, each element of the iterator corresponds to text
+   * that *isn't* matched by the regular expression. The remainder of the
+   * string that is not split will be the last element in the iterator.
    *
-   * It is recommended to use this method if all you need to do is test
-   * a match, since the underlying matching engine may be able to do less
-   * work.
+   * This method will *not* copy the text given.
    *
    * # Example
    *
-   * Test if some text contains at least one word with exactly 13
-   * Unicode word characters:
+   * Get the first two words in some text:
    *
    * ```typescript
    * import { RRegex } from "rregex"
    *
-   * const text = "I categorically deny having triskaidekaphobia."
-   * expect(new RRegex("\\b\\w{13}\\b").is_match(text)).toBe(true)
+   * const re = new RRegex(r"\\W+")
+   * const fields = re.splitn("Hey! How are you?", 3)
+   * expect(fields).toEqual(["Hey", "How", "are you?"])
    * ```
-   *
-   * @see https://docs.rs/regex/latest/regex/struct.Regex.html#method.is_match
+   * @see https://docs.rs/regex/latest/regex/struct.Regex.html#method.splitn
    * @param {string} text - The string against which to match the regular expression
-   * @return {boolean}
+   * @param {number} limit - Max number result elements
+   * @returns {string[]}
    */
-  isMatch(text: string): boolean;
+  splitn(text: string, limit: number): string[];
   /**
-   * Replaces at most `limit` non-overlapping matches in `text` with the
-   * replacement provided. If `limit` is 0, then all non-overlapping matches
-   * are replaced.
-   *
-   * See the documentation for `replace` for details on how to access
-   * capturing group matches in the replacement string.
-   *
-   * @see https://docs.rs/regex/latest/regex/struct.Regex.html#method.replacen
-   * @param {string} text - The string against which to match the regular expression
-   * @param {number} limit - Max number of replacement
-   * @param {string} rep - It's a string, it will replace the substring matched by `pattern`.
-   * @returns {string}
+   * Returns the regular expression into a high level intermediate
+   * representation.
    */
-  replacen(text: string, limit: number, rep: string): string;
+  syntax(): Hir;
   /**
    * Returns a string representing the regular expression
    */
@@ -1115,25 +1109,39 @@ export declare class RRegex {
  */
 export declare class RRegexSet {
   free(): void;
+  [Symbol.dispose](): void;
   /**
-   * Create a new regex set with the given regular expressions.
+   * Returns true if and only if one of the regexes in this set matches
+   * the text given.
    *
-   * This takes an array of strings, if any item in the list is not a valid regular
-   * expression, then an error is returned. Options only apply to this
-   * instance, see `RRegexOptions`.
+   * This method should be preferred if you only need to test whether any
+   * of the regexes in the set should match, but don't care about *which*
+   * regexes matched. This is because the underlying matching engine will
+   * quit immediately after seeing the first match instead of continuing to
+   * find all matches.
+   *
+   * Note that as with searches using `Regex`, the expression is unanchored
+   * by default. That is, if the regex does not start with `^` or `\A`, or
+   * end with `$` or `\z`, then it is permitted to match anywhere in the
+   * text.
    *
    * # Example
    *
-   * Create a new regex set from an iterator of strings:
+   * Tests whether a set matches some text:
    *
    * ```typescript
    * import { RegexSet } from "rregex"
    *
    * const set = new RegexSet(["\\w+", "\\d+"])
    * expect(set.is_match("foo")).toBe(true)
+   * expect(!set.is_match("☃")).toBe(false)
    * ```
+   *
+   * @see https://docs.rs/regex/latest/regex/struct.RegexSet.html#method.is_match
+   * @param {string} text - The string against which to match the regular expression
+   * @return {boolean}
    */
-  constructor(list: string[], options?: RRegexOptions | null);
+  isMatch(text: string): boolean;
   /**
    * Returns the set of regular expressions that match in the given text.
    *
@@ -1174,42 +1182,38 @@ export declare class RRegexSet {
    */
   matches(text: string): number[];
   /**
-   * Returns true if and only if one of the regexes in this set matches
-   * the text given.
-   *
-   * This method should be preferred if you only need to test whether any
-   * of the regexes in the set should match, but don't care about *which*
-   * regexes matched. This is because the underlying matching engine will
-   * quit immediately after seeing the first match instead of continuing to
-   * find all matches.
+   * Create a new regex set with the given regular expressions.
    *
-   * Note that as with searches using `Regex`, the expression is unanchored
-   * by default. That is, if the regex does not start with `^` or `\A`, or
-   * end with `$` or `\z`, then it is permitted to match anywhere in the
-   * text.
+   * This takes an array of strings, if any item in the list is not a valid regular
+   * expression, then an error is returned. Options only apply to this
+   * instance, see `RRegexOptions`.
    *
    * # Example
    *
-   * Tests whether a set matches some text:
+   * Create a new regex set from an iterator of strings:
    *
    * ```typescript
    * import { RegexSet } from "rregex"
    *
    * const set = new RegexSet(["\\w+", "\\d+"])
    * expect(set.is_match("foo")).toBe(true)
-   * expect(!set.is_match("☃")).toBe(false)
    * ```
-   *
-   * @see https://docs.rs/regex/latest/regex/struct.RegexSet.html#method.is_match
-   * @param {string} text - The string against which to match the regular expression
-   * @return {boolean}
    */
-  isMatch(text: string): boolean;
+  constructor(list: string[], options?: RRegexOptions | null);
 }
+/**
+ * Escapes all regular expression meta characters in `text`.
+ *
+ * The string returned may be safely used as a literal in a regular
+ * expression.
+ */
+export declare function escape(text: string): string;
 export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembly.Module;
 export interface InitOutput {
   readonly memory: WebAssembly.Memory;
   readonly __wbg_rregex_free: (a: number, b: number) => void;
+  readonly __wbg_rregexset_free: (a: number, b: number) => void;
+  readonly escape: (a: number, b: number) => [number, number];
   readonly rregex_captureNames: (a: number) => [number, number];
   readonly rregex_captures: (a: number, b: number, c: number) => [number, number, number];
   readonly rregex_capturesAll: (a: number, b: number, c: number) => [number, number, number];
@@ -1229,19 +1233,17 @@ export interface InitOutput {
   readonly rregex_splitn: (a: number, b: number, c: number, d: number) => [number, number];
   readonly rregex_syntax: (a: number) => [number, number, number];
   readonly rregex_toString: (a: number) => [number, number];
-  readonly __wbg_rregexset_free: (a: number, b: number) => void;
   readonly rregexset_isMatch: (a: number, b: number, c: number) => number;
   readonly rregexset_matches: (a: number, b: number, c: number) => [number, number];
   readonly rregexset_new: (a: any, b: number) => [number, number, number];
-  readonly escape: (a: number, b: number) => [number, number];
-  readonly __wbindgen_exn_store: (a: number) => void;
-  readonly __externref_table_alloc: () => number;
-  readonly __wbindgen_export_2: WebAssembly.Table;
   readonly __wbindgen_malloc: (a: number, b: number) => number;
   readonly __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number;
   readonly __wbindgen_free: (a: number, b: number, c: number) => void;
-  readonly __externref_table_dealloc: (a: number) => void;
+  readonly __wbindgen_exn_store: (a: number) => void;
+  readonly __externref_table_alloc: () => number;
+  readonly __wbindgen_externrefs: WebAssembly.Table;
   readonly __externref_drop_slice: (a: number, b: number) => void;
+  readonly __externref_table_dealloc: (a: number) => void;
   readonly __wbindgen_start: () => void;
 }
 export type SyncInitInput = BufferSource | WebAssembly.Module;

Changed: esm.d.mts

217 line(s) added (+), 215 line(s) removed (-)

@@ -1,13 +1,6 @@
 
 /* tslint:disable */
 /* eslint-disable */
-/**
- * Escapes all regular expression meta characters in `text`.
- *
- * The string returned may be safely used as a literal in a regular
- * expression.
- */
-export declare function escape(text: string): string;
 /**
  * Represents a single match of a regex in a haystack.
  *
@@ -663,33 +656,13 @@ export type RRegexOptions = {
  */
 export declare class RRegex {
   free(): void;
+  [Symbol.dispose](): void;
   /**
-   * Returns the same as is_match, but starts the search at the given offset.
-   * The significance of the starting point is that it takes the surrounding
-   * context into consideration. For example, the `\A` anchor can only match
-   * when `start == 0`.
-   *
-   * @see https://docs.rs/regex/latest/regex/struct.Regex.html#method.is_match_at
-   * @param {string} text - The string against which to match the regular expression
-   * @param {number} start - Zero-based index at which to start matching
-   * @return {boolean}
-   */
-  isMatchAt(text: string, start: number): boolean;
-  /**
-   * Replaces all non-overlapping matches in `text` with the replacement
-   * provided. This is the same as calling `replacen` with `limit` set to
-   * `0`.
-   *
-   * See the documentation for `replace` for details on how to access
-   * capturing group matches in the replacement string.
+   * Returns a list of the capture names in this regex.
    *
-   * See the documentation for `replace` for details on how to access capturing group matches in the replacement string.
-   * @see https://docs.rs/regex/latest/regex/struct.Regex.html#method.replace_all
-   * @param {string} text - The string against which to match the regular expression
-   * @param {string} rep - It's a string, it will replace the substring matched by `pattern`.
-   * @returns {string}
+   * @see https://docs.rs/regex/latest/regex/struct.Regex.html#method.capture_names
    */
-  replaceAll(text: string, rep: string): string;
+  captureNames(): (string | null)[];
   /**
    * Returns a list with all the non-overlapping capture groups matched
    * in `text`. This is operationally the same as `findAll`, except it
@@ -756,66 +729,88 @@ export declare class RRegex {
    */
   capturesLength(): number;
   /**
-   * Returns a list of the capture names in this regex.
+   * Returns the capture groups corresponding to the leftmost-first
+   * match in `text`. Capture group `0` always corresponds to the entire
+   * match. If no match is found, then `undefined` is returned.
    *
-   * @see https://docs.rs/regex/latest/regex/struct.Regex.html#method.capture_names
-   */
-  captureNames(): (string | null)[];
-  /**
-   * Returns the end location of a match in the text given.
+   * You should only use `captures` if you need access to the location of
+   * capturing group matches. Otherwise, `find` is faster for discovering
+   * the location of the overall match.
    *
-   * This method may have the same performance characteristics as
-   * `isMatch`, except it provides an end location for a match. In
-   * particular, the location returned *may be shorter* than the proper end
-   * of the leftmost-first match that you would find via `Regex.find`.
+   * # Examples
    *
-   * Note that it is not guaranteed that this routine finds the shortest or
-   * "earliest" possible match. Instead, the main idea of this API is that
-   * it returns the offset at the point at which the internal regex engine
-   * has determined that a match has occurred. This may vary depending on
-   * which internal regex engine is used, and thus, the offset itself may
-   * change.
+   * Say you have some text with movie names and their release years,
+   * like "'Citizen Kane' (1941)". It'd be nice if we could search for text
+   * looking like that, while also extracting the movie name and its release
+   * year separately.
    *
-   * # Example
+   * ```typescript
+   * import { RRegex } from "rregex"
    *
-   * Typically, `a+` would match the entire first sequence of `a` in some
-   * text, but `shortest_match` can give up as soon as it sees the first
-   * `a`.
+   * const re = new RRegex("'([^']+)'\\s+\\((\\d{4})\)")
+   * const text = "Not my favorite movie: 'Citizen Kane' (1941)."
+   * const caps = re.captures(text)
+   * expect(caps.get[1].value).toBe("Citizen Kane")
+   * expect(caps.get[2].value).toBe("1941")
+   * expect(caps.get[0].value).toBe("'Citizen Kane' (1941)")
+   * ```
+   *
+   * Note that the full match is at capture group `0`. Each subsequent
+   * capture group is indexed by the order of its opening `(`.
+   *
+   * We can make this example a bit clearer by using *named* capture groups:
    *
    * ```typescript
    * import { RRegex } from "rregex"
    *
-   * const text = "aaaaa"
-   * const = new RRegex("a+").shortest_match(text)
-   * expect(pos).toBe(1)
+   * const re = new RRegex("'(?P<title>[^']+)'\\s+\\((?P<year>\\d{4})\)")
+   * const text = "Not my favorite movie: 'Citizen Kane' (1941)."
+   * const caps = re.captures(text)
+   * expect(caps.name["title"].value).toBe("Citizen Kane")
+   * expect(caps.name["year"].value).toBe("1941")
+   * expect(caps.get[0].value).toBe("'Citizen Kane' (1941)")
    * ```
    *
-   * @see https://docs.rs/regex/latest/regex/struct.Regex.html#method.shortest_match
+   * @see https://docs.rs/regex/latest/regex/struct.Regex.html#method.captures
    * @param {string} text - The string against which to match the regular expression
-   * @returns {number|undefined}
+   * @returns {Captures|undefined}
    */
-  shortestMatch(text: string): number | undefined;
+  captures(text: string): Captures | undefined;
   /**
-   * Returns the same as `shortest_match`, but starts the search at the
-   * given offset.
+   * Returns an array for each successive non-overlapping match in `text``,
+   * returning the start and end byte indices with respect to `text`.
    *
-   * The significance of the starting point is that it takes the surrounding
-   * context into consideration. For example, the `\A` anchor can only match
-   * when `start == 0`.
-   * @see https://docs.rs/regex/latest/regex/struct.Regex.html#method.shortest_match_at
+   * # Example
+   *
+   * Find the start and end location of every word with exactly 13 Unicode
+   * word characters:
+   *
+   * ```typescript
+   * import { RRegex } from "rregex"
+   *
+   * const text = "Retroactively relinquishing remunerations is reprehensible."
+   * const matches = new RRegex("\\b\\w{13}\\b").findAll(text)
+   * ```
+   *
+   * @see https://docs.rs/regex/latest/regex/struct.Regex.html#method.find_iter
    * @param {string} text - The string against which to match the regular expression
-   * @param {number} start - Zero-based index at which to start matching
-   * @returns {number|undefined}
+   * @returns {Match}
    */
-  shortestMatchAt(text: string, start: number): number | undefined;
+  findAll(text: string): Match[];
   /**
-   * Compiles a regular expression. Once compiled, it can be used repeatedly
-   * to search, split or replace text in a string.
+   * Returns the same as find, but starts the search at the given
+   * offset.
    *
-   * If an invalid expression is given, then an error is returned.
-   * Options only apply to this instance, see `RRegexOptions`.
+   * The significance of the starting point is that it takes the surrounding
+   * context into consideration. For example, the `\A` anchor can only
+   * match when `start == 0`.
+   *
+   * @see https://docs.rs/regex/latest/regex/struct.Regex.html#method.find_at
+   * @param {string} text - The string against which to match the regular expression
+   * @param {number} start - Zero-based index at which to start matching
+   * @returns {Match}
    */
-  constructor(re: string, options?: RRegexOptions | null);
+  findAt(text: string, start: number): Match | undefined;
   /**
    * Returns the start and end byte range of the leftmost-first match in
    * `text`. If no match exists, then `undefined` is returned.
@@ -844,74 +839,65 @@ export declare class RRegex {
    */
   find(text: string): Match | undefined;
   /**
-   * Returns an iterator of substrings of `text` delimited by a match of the
-   * regular expression. Namely, each element of the iterator corresponds to
-   * text that *isn't* matched by the regular expression.
-   *
-   * This method will *not* copy the text given.
-   *
-   * # Example
-   *
-   * To split a string delimited by arbitrary amounts of spaces or tabs:
-   *
-   * ```typescript
-   * import { RRegex } from "rregex"
-   *
-   * const re = new RRegex(r"[ \\t]+")
-   * const fields = re.split("a b \t  c\td    e")
-   * expect(fields).toEqual(["a", "b", "c", "d", "e"])
-   * ```
+   * Returns the same as is_match, but starts the search at the given offset.
+   * The significance of the starting point is that it takes the surrounding
+   * context into consideration. For example, the `\A` anchor can only match
+   * when `start == 0`.
    *
-   * @see https://docs.rs/regex/latest/regex/struct.Regex.html#method.split
+   * @see https://docs.rs/regex/latest/regex/struct.Regex.html#method.is_match_at
    * @param {string} text - The string against which to match the regular expression
-   * @returns {string[]}
+   * @param {number} start - Zero-based index at which to start matching
+   * @return {boolean}
    */
-  split(text: string): string[];
+  isMatchAt(text: string, start: number): boolean;
   /**
-   * Returns an iterator of at most `limit` substrings of `text` delimited
-   * by a match of the regular expression. (A `limit` of `0` will return no
-   * substrings.) Namely, each element of the iterator corresponds to text
-   * that *isn't* matched by the regular expression. The remainder of the
-   * string that is not split will be the last element in the iterator.
+   * Returns true if and only if there is a match for the regex in the
+   * string given.
    *
-   * This method will *not* copy the text given.
+   * It is recommended to use this method if all you need to do is test
+   * a match, since the underlying matching engine may be able to do less
+   * work.
    *
    * # Example
    *
-   * Get the first two words in some text:
+   * Test if some text contains at least one word with exactly 13
+   * Unicode word characters:
    *
    * ```typescript
    * import { RRegex } from "rregex"
    *
-   * const re = new RRegex(r"\\W+")
-   * const fields = re.splitn("Hey! How are you?", 3)
-   * expect(fields).toEqual(["Hey", "How", "are you?"])
+   * const text = "I categorically deny having triskaidekaphobia."
+   * expect(new RRegex("\\b\\w{13}\\b").is_match(text)).toBe(true)
    * ```
-   * @see https://docs.rs/regex/latest/regex/struct.Regex.html#method.splitn
+   *
+   * @see https://docs.rs/regex/latest/regex/struct.Regex.html#method.is_match
    * @param {string} text - The string against which to match the regular expression
-   * @param {number} limit - Max number result elements
-   * @returns {string[]}
+   * @return {boolean}
    */
-  splitn(text: string, limit: number): string[];
+  isMatch(text: string): boolean;
   /**
-   * Returns the regular expression into a high level intermediate
-   * representation.
+   * Compiles a regular expression. Once compiled, it can be used repeatedly
+   * to search, split or replace text in a string.
+   *
+   * If an invalid expression is given, then an error is returned.
+   * Options only apply to this instance, see `RRegexOptions`.
    */
-  syntax(): Hir;
+  constructor(re: string, options?: RRegexOptions | null);
   /**
-   * Returns the same as find, but starts the search at the given
-   * offset.
+   * Replaces all non-overlapping matches in `text` with the replacement
+   * provided. This is the same as calling `replacen` with `limit` set to
+   * `0`.
    *
-   * The significance of the starting point is that it takes the surrounding
-   * context into consideration. For example, the `\A` anchor can only
-   * match when `start == 0`.
+   * See the documentation for `replace` for details on how to access
+   * capturing group matches in the replacement string.
    *
-   * @see https://docs.rs/regex/latest/regex/struct.Regex.html#method.find_at
+   * See the documentation for `replace` for details on how to access capturing group matches in the replacement string.
+   * @see https://docs.rs/regex/latest/regex/struct.Regex.html#method.replace_all
    * @param {string} text - The string against which to match the regular expression
-   * @param {number} start - Zero-based index at which to start matching
-   * @returns {Match}
+   * @param {string} rep - It's a string, it will replace the substring matched by `pattern`.
+   * @returns {string}
    */
-  findAt(text: string, start: number): Match | undefined;
+  replaceAll(text: string, rep: string): string;
   /**
    * Replaces the leftmost-first match with the replacement provided.
    * The replacement can be a regular string (where `$N` and `$name` are
@@ -989,114 +975,122 @@ export declare class RRegex {
    */
   replace(text: string, rep: string): string;
   /**
-   * Returns the capture groups corresponding to the leftmost-first
-   * match in `text`. Capture group `0` always corresponds to the entire
-   * match. If no match is found, then `undefined` is returned.
+   * Replaces at most `limit` non-overlapping matches in `text` with the
+   * replacement provided. If `limit` is 0, then all non-overlapping matches
+   * are replaced.
    *
-   * You should only use `captures` if you need access to the location of
-   * capturing group matches. Otherwise, `find` is faster for discovering
-   * the location of the overall match.
+   * See the documentation for `replace` for details on how to access
+   * capturing group matches in the replacement string.
    *
-   * # Examples
+   * @see https://docs.rs/regex/latest/regex/struct.Regex.html#method.replacen
+   * @param {string} text - The string against which to match the regular expression
+   * @param {number} limit - Max number of replacement
+   * @param {string} rep - It's a string, it will replace the substring matched by `pattern`.
+   * @returns {string}
+   */
+  replacen(text: string, limit: number, rep: string): string;
+  /**
+   * Returns the same as `shortest_match`, but starts the search at the
+   * given offset.
    *
-   * Say you have some text with movie names and their release years,
-   * like "'Citizen Kane' (1941)". It'd be nice if we could search for text
-   * looking like that, while also extracting the movie name and its release
-   * year separately.
+   * The significance of the starting point is that it takes the surrounding
+   * context into consideration. For example, the `\A` anchor can only match
+   * when `start == 0`.
+   * @see https://docs.rs/regex/latest/regex/struct.Regex.html#method.shortest_match_at
+   * @param {string} text - The string against which to match the regular expression
+   * @param {number} start - Zero-based index at which to start matching
+   * @returns {number|undefined}
+   */
+  shortestMatchAt(text: string, start: number): number | undefined;
+  /**
+   * Returns the end location of a match in the text given.
    *
-   * ```typescript
-   * import { RRegex } from "rregex"
+   * This method may have the same performance characteristics as
+   * `isMatch`, except it provides an end location for a match. In
+   * particular, the location returned *may be shorter* than the proper end
+   * of the leftmost-first match that you would find via `Regex.find`.
    *
-   * const re = new RRegex("'([^']+)'\\s+\\((\\d{4})\)")
-   * const text = "Not my favorite movie: 'Citizen Kane' (1941)."
-   * const caps = re.captures(text)
-   * expect(caps.get[1].value).toBe("Citizen Kane")
-   * expect(caps.get[2].value).toBe("1941")
-   * expect(caps.get[0].value).toBe("'Citizen Kane' (1941)")
-   * ```
+   * Note that it is not guaranteed that this routine finds the shortest or
+   * "earliest" possible match. Instead, the main idea of this API is that
+   * it returns the offset at the point at which the internal regex engine
+   * has determined that a match has occurred. This may vary depending on
+   * which internal regex engine is used, and thus, the offset itself may
+   * change.
    *
-   * Note that the full match is at capture group `0`. Each subsequent
-   * capture group is indexed by the order of its opening `(`.
+   * # Example
    *
-   * We can make this example a bit clearer by using *named* capture groups:
+   * Typically, `a+` would match the entire first sequence of `a` in some
+   * text, but `shortest_match` can give up as soon as it sees the first
+   * `a`.
    *
    * ```typescript
    * import { RRegex } from "rregex"
    *
-   * const re = new RRegex("'(?P<title>[^']+)'\\s+\\((?P<year>\\d{4})\)")
-   * const text = "Not my favorite movie: 'Citizen Kane' (1941)."
-   * const caps = re.captures(text)
-   * expect(caps.name["title"].value).toBe("Citizen Kane")
-   * expect(caps.name["year"].value).toBe("1941")
-   * expect(caps.get[0].value).toBe("'Citizen Kane' (1941)")
+   * const text = "aaaaa"
+   * const = new RRegex("a+").shortest_match(text)
+   * expect(pos).toBe(1)
    * ```
    *
-   * @see https://docs.rs/regex/latest/regex/struct.Regex.html#method.captures
+   * @see https://docs.rs/regex/latest/regex/struct.Regex.html#method.shortest_match
    * @param {string} text - The string against which to match the regular expression
-   * @returns {Captures|undefined}
+   * @returns {number|undefined}
    */
-  captures(text: string): Captures | undefined;
+  shortestMatch(text: string): number | undefined;
   /**
-   * Returns an array for each successive non-overlapping match in `text``,
-   * returning the start and end byte indices with respect to `text`.
+   * Returns an iterator of substrings of `text` delimited by a match of the
+   * regular expression. Namely, each element of the iterator corresponds to
+   * text that *isn't* matched by the regular expression.
+   *
+   * This method will *not* copy the text given.
    *
    * # Example
    *
-   * Find the start and end location of every word with exactly 13 Unicode
-   * word characters:
+   * To split a string delimited by arbitrary amounts of spaces or tabs:
    *
    * ```typescript
    * import { RRegex } from "rregex"
    *
-   * const text = "Retroactively relinquishing remunerations is reprehensible."
-   * const matches = new RRegex("\\b\\w{13}\\b").findAll(text)
+   * const re = new RRegex(r"[ \\t]+")
+   * const fields = re.split("a b \t  c\td    e")
+   * expect(fields).toEqual(["a", "b", "c", "d", "e"])
    * ```
    *
-   * @see https://docs.rs/regex/latest/regex/struct.Regex.html#method.find_iter
+   * @see https://docs.rs/regex/latest/regex/struct.Regex.html#method.split
    * @param {string} text - The string against which to match the regular expression
-   * @returns {Match}
+   * @returns {string[]}
    */
-  findAll(text: string): Match[];
+  split(text: string): string[];
   /**
-   * Returns true if and only if there is a match for the regex in the
-   * string given.
+   * Returns an iterator of at most `limit` substrings of `text` delimited
+   * by a match of the regular expression. (A `limit` of `0` will return no
+   * substrings.) Namely, each element of the iterator corresponds to text
+   * that *isn't* matched by the regular expression. The remainder of the
+   * string that is not split will be the last element in the iterator.
    *
-   * It is recommended to use this method if all you need to do is test
-   * a match, since the underlying matching engine may be able to do less
-   * work.
+   * This method will *not* copy the text given.
    *
    * # Example
    *
-   * Test if some text contains at least one word with exactly 13
-   * Unicode word characters:
+   * Get the first two words in some text:
    *
    * ```typescript
    * import { RRegex } from "rregex"
    *
-   * const text = "I categorically deny having triskaidekaphobia."
-   * expect(new RRegex("\\b\\w{13}\\b").is_match(text)).toBe(true)
+   * const re = new RRegex(r"\\W+")
+   * const fields = re.splitn("Hey! How are you?", 3)
+   * expect(fields).toEqual(["Hey", "How", "are you?"])
    * ```
-   *
-   * @see https://docs.rs/regex/latest/regex/struct.Regex.html#method.is_match
+   * @see https://docs.rs/regex/latest/regex/struct.Regex.html#method.splitn
    * @param {string} text - The string against which to match the regular expression
-   * @return {boolean}
+   * @param {number} limit - Max number result elements
+   * @returns {string[]}
    */
-  isMatch(text: string): boolean;
+  splitn(text: string, limit: number): string[];
   /**
-   * Replaces at most `limit` non-overlapping matches in `text` with the
-   * replacement provided. If `limit` is 0, then all non-overlapping matches
-   * are replaced.
-   *
-   * See the documentation for `replace` for details on how to access
-   * capturing group matches in the replacement string.
-   *
-   * @see https://docs.rs/regex/latest/regex/struct.Regex.html#method.replacen
-   * @param {string} text - The string against which to match the regular expression
-   * @param {number} limit - Max number of replacement
-   * @param {string} rep - It's a string, it will replace the substring matched by `pattern`.
-   * @returns {string}
+   * Returns the regular expression into a high level intermediate
+   * representation.
    */
-  replacen(text: string, limit: number, rep: string): string;
+  syntax(): Hir;
   /**
    * Returns a string representing the regular expression
    */
@@ -1116,25 +1110,39 @@ export declare class RRegex {
  */
 export declare class RRegexSet {
   free(): void;
+  [Symbol.dispose](): void;
   /**
-   * Create a new regex set with the given regular expressions.
+   * Returns true if and only if one of the regexes in this set matches
+   * the text given.
    *
-   * This takes an array of strings, if any item in the list is not a valid regular
-   * expression, then an error is returned. Options only apply to this
-   * instance, see `RRegexOptions`.
+   * This method should be preferred if you only need to test whether any
+   * of the regexes in the set should match, but don't care about *which*
+   * regexes matched. This is because the underlying matching engine will
+   * quit immediately after seeing the first match instead of continuing to
+   * find all matches.
+   *
+   * Note that as with searches using `Regex`, the expression is unanchored
+   * by default. That is, if the regex does not start with `^` or `\A`, or
+   * end with `$` or `\z`, then it is permitted to match anywhere in the
+   * text.
    *
    * # Example
    *
-   * Create a new regex set from an iterator of strings:
+   * Tests whether a set matches some text:
    *
    * ```typescript
    * import { RegexSet } from "rregex"
    *
    * const set = new RegexSet(["\\w+", "\\d+"])
    * expect(set.is_match("foo")).toBe(true)
+   * expect(!set.is_match("☃")).toBe(false)
    * ```
+   *
+   * @see https://docs.rs/regex/latest/regex/struct.RegexSet.html#method.is_match
+   * @param {string} text - The string against which to match the regular expression
+   * @return {boolean}
    */
-  constructor(list: string[], options?: RRegexOptions | null);
+  isMatch(text: string): boolean;
   /**
    * Returns the set of regular expressions that match in the given text.
    *
@@ -1175,42 +1183,38 @@ export declare class RRegexSet {
    */
   matches(text: string): number[];
   /**
-   * Returns true if and only if one of the regexes in this set matches
-   * the text given.
-   *
-   * This method should be preferred if you only need to test whether any
-   * of the regexes in the set should match, but don't care about *which*
-   * regexes matched. This is because the underlying matching engine will
-   * quit immediately after seeing the first match instead of continuing to
-   * find all matches.
+   * Create a new regex set with the given regular expressions.
    *
-   * Note that as with searches using `Regex`, the expression is unanchored
-   * by default. That is, if the regex does not start with `^` or `\A`, or
-   * end with `$` or `\z`, then it is permitted to match anywhere in the
-   * text.
+   * This takes an array of strings, if any item in the list is not a valid regular
+   * expression, then an error is returned. Options only apply to this
+   * instance, see `RRegexOptions`.
    *
    * # Example
    *
-   * Tests whether a set matches some text:
+   * Create a new regex set from an iterator of strings:
    *
    * ```typescript
    * import { RegexSet } from "rregex"
    *
    * const set = new RegexSet(["\\w+", "\\d+"])
    * expect(set.is_match("foo")).toBe(true)
-   * expect(!set.is_match("☃")).toBe(false)
    * ```
-   *
-   * @see https://docs.rs/regex/latest/regex/struct.RegexSet.html#method.is_match
-   * @param {string} text - The string against which to match the regular expression
-   * @return {boolean}
    */
-  isMatch(text: string): boolean;
+  constructor(list: string[], options?: RRegexOptions | null);
 }
+/**
+ * Escapes all regular expression meta characters in `text`.
+ *
+ * The string returned may be safely used as a literal in a regular
+ * expression.
+ */
+export declare function escape(text: string): string;
 export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembly.Module;
 export interface InitOutput {
   readonly memory: WebAssembly.Memory;
   readonly __wbg_rregex_free: (a: number, b: number) => void;
+  readonly __wbg_rregexset_free: (a: number, b: number) => void;
+  readonly escape: (a: number, b: number) => [number, number];
   readonly rregex_captureNames: (a: number) => [number, number];
   readonly rregex_captures: (a: number, b: number, c: number) => [number, number, number];
   readonly rregex_capturesAll: (a: number, b: number, c: number) => [number, number, number];
@@ -1230,19 +1234,17 @@ export interface InitOutput {
   readonly rregex_splitn: (a: number, b: number, c: number, d: number) => [number, number];
   readonly rregex_syntax: (a: number) => [number, number, number];
   readonly rregex_toString: (a: number) => [number, number];
-  readonly __wbg_rregexset_free: (a: number, b: number) => void;
   readonly rregexset_isMatch: (a: number, b: number, c: number) => number;
   readonly rregexset_matches: (a: number, b: number, c: number) => [number, number];
   readonly rregexset_new: (a: any, b: number) => [number, number, number];
-  readonly escape: (a: number, b: number) => [number, number];
-  readonly __wbindgen_exn_store: (a: number) => void;
-  readonly __externref_table_alloc: () => number;
-  readonly __wbindgen_export_2: WebAssembly.Table;
   readonly __wbindgen_malloc: (a: number, b: number) => number;
   readonly __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number;
   readonly __wbindgen_free: (a: number, b: number, c: number) => void;
-  readonly __externref_table_dealloc: (a: number) => void;
+  readonly __wbindgen_exn_store: (a: number) => void;
+  readonly __externref_table_alloc: () => number;
+  readonly __wbindgen_externrefs: WebAssembly.Table;
   readonly __externref_drop_slice: (a: number, b: number) => void;
+  readonly __externref_table_dealloc: (a: number) => void;
   readonly __wbindgen_start: () => void;
 }
 export type SyncInitInput = BufferSource | WebAssembly.Module;

Workflow run · updated for 63ddfb2

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependencies Pull requests that update a dependency file rust Pull requests that update rust code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants