rregex 1.10.12 → 1.10.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,1257 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+ /**
4
+ * Escapes all regular expression meta characters in `text`.
5
+ *
6
+ * The string returned may be safely used as a literal in a regular
7
+ * expression.
8
+ */
9
+ export function escape(text: string): string;
10
+ /**
11
+ * Represents a single match of a regex in a haystack.
12
+ *
13
+ * A `Match` contains both the start and end byte offsets of the match and the
14
+ * actual substring corresponding to the range of those byte offsets. It is
15
+ * guaranteed that `start <= end`. When `start == end`, the match is empty.
16
+ *
17
+ * Since this `Match` can only be produced by the top-level `Regex` APIs
18
+ * that only support searching UTF-8 encoded strings, the byte offsets for a
19
+ * `Match` are guaranteed to fall on valid UTF-8 codepoint boundaries. That
20
+ * is, slicing an `Uint8Array` created with a TextEncoder is guaranteed to never
21
+ * be out of range.
22
+ *
23
+ * # Numbering
24
+ *
25
+ * The byte offsets in a `Match` form a half-open interval. That is, the
26
+ * start of the range is inclusive and the end of the range is exclusive.
27
+ * For example, given a haystack `abcFOOxyz` and a match of `FOO`, its byte
28
+ * offset range starts at `3` and ends at `6`. `3` corresponds to `F` and
29
+ * `6` corresponds to `x`, which is one past the end of the match. This
30
+ * corresponds to the same kind of slicing that Rust uses.
31
+ *
32
+ * For more on why this was chosen over other schemes (aside from being
33
+ * consistent with how Rust the language works), see [this discussion] and
34
+ * [Dijkstra's note on a related topic][note].
35
+ *
36
+ * [this discussion]: https://github.com/rust-lang/regex/discussions/866
37
+ * [note]: https://www.cs.utexas.edu/users/EWD/transcriptions/EWD08xx/EWD831.html
38
+ *
39
+ * # Example
40
+ *
41
+ * This example shows the value of each of the methods on `Match` for a
42
+ * particular search.
43
+ *
44
+ * ```typescript
45
+ * import { RRegex } from "rregex"
46
+ *
47
+ * const re = new RRegex("\\p{Greek}+");
48
+ * const hay = "Greek: αβγδ";
49
+ * const m = re.find(hay);
50
+ * expect(m.start).toBe(7);
51
+ * expect(m.end).toBe(15);
52
+ * expect(m.value).toBe("αβγδ");
53
+ * ```
54
+ *
55
+ * @see @see https://docs.rs/regex/latest/regex/
56
+ */
57
+ export type Match = {
58
+ start: number
59
+ end: number
60
+ value: string
61
+ }
62
+
63
+ /**
64
+ * A high-level intermediate representation (HIR) for a regular expression.
65
+ */
66
+ export type Hir = {
67
+ '@type': 'struct'
68
+ '@name': 'regex_syntax::hir::Hir'
69
+ kind: HirKind
70
+ }
71
+
72
+ /**
73
+ * The underlying kind of an arbitrary `Hir` expression.
74
+ *
75
+ * An `HirKind` is principally useful for doing case analysis on the type of a
76
+ * regular expression. If you're looking to build new `Hir` values, then you must
77
+ * use the smart constructors defined on `Hir`, like `Hir::repetition`, to build
78
+ * new `Hir` values. The API intentionally does not expose any way of building an
79
+ * `Hir` directly from an `HirKind`.
80
+ */
81
+ export type HirKind =
82
+ | HirKindEmptyVariant
83
+ | HirKindLiteralVariant
84
+ | HirKindClassVariant
85
+ | HirKindLookVariant
86
+ | HirKindRepetitionVariant
87
+ | HirKindCaptureVariant
88
+ | HirKindConcatVariant
89
+ | HirKindAlternationVariant
90
+
91
+ /**
92
+ * The empty regular expression, which matches everything, including the empty string.
93
+ */
94
+ export type HirKindEmptyVariant = {
95
+ '@type': 'enum'
96
+ '@name': 'regex_syntax::hir::HirKind'
97
+ '@variant': 'Empty'
98
+ }
99
+
100
+ /**
101
+ * A literal string that matches exactly these bytes.
102
+ */
103
+ export type HirKindLiteralVariant = {
104
+ '@type': 'enum'
105
+ '@name': 'regex_syntax::hir::HirKind'
106
+ '@variant': 'Literal'
107
+ '@values': [Literal]
108
+ }
109
+
110
+ /**
111
+ * A single character class that matches any of the characters in the class.
112
+ * A class can either consist of Unicode scalar values as characters, or it can
113
+ * use bytes.
114
+ *
115
+ * A class may be empty. In which case, it matches nothing.
116
+ */
117
+ export type HirKindClassVariant = {
118
+ '@type': 'enum'
119
+ '@name': 'regex_syntax::hir::HirKind'
120
+ '@variant': 'Class'
121
+ '@values': [Class]
122
+ }
123
+
124
+ /**
125
+ * A look-around assertion. A look-around match always has zero length.
126
+ */
127
+ export type HirKindLookVariant = {
128
+ '@type': 'enum'
129
+ '@name': 'regex_syntax::hir::HirKind'
130
+ '@variant': 'Look'
131
+ '@values': [Look]
132
+ }
133
+
134
+ /**
135
+ * A repetition operation applied to a sub-expression.
136
+ */
137
+ export type HirKindRepetitionVariant = {
138
+ '@type': 'enum'
139
+ '@name': 'regex_syntax::hir::HirKind'
140
+ '@variant': 'Repetition'
141
+ '@values': [Repetition]
142
+ }
143
+
144
+ /**
145
+ * A capturing group, which contains a sub-expression.
146
+ */
147
+ export type HirKindCaptureVariant = {
148
+ '@type': 'enum'
149
+ '@name': 'regex_syntax::hir::HirKind'
150
+ '@variant': 'Capture'
151
+ '@values': [Capture]
152
+ }
153
+
154
+ /**
155
+ * A concatenation of expressions.
156
+ *
157
+ * A concatenation matches only if each of its sub-expressions match one after
158
+ * the other.
159
+ *
160
+ * Concatenations are guaranteed by `Hir`'s smart constructors to always have at
161
+ * least two sub-expressions.
162
+ */
163
+ export type HirKindConcatVariant = {
164
+ '@type': 'enum'
165
+ '@name': 'regex_syntax::hir::HirKind'
166
+ '@variant': 'Concat'
167
+ '@values': [Hir[]]
168
+ }
169
+
170
+ /**
171
+ * An alternation of expressions.
172
+ *
173
+ * An alternation matches only if at least one of its sub-expressions match.
174
+ * If multiple sub-expressions match, then the leftmost is preferred.
175
+ *
176
+ * Alternations are guaranteed by `Hir`'s smart constructors to always have at
177
+ * least two sub-expressions.
178
+ */
179
+ export type HirKindAlternationVariant = {
180
+ '@type': 'enum'
181
+ '@name': 'regex_syntax::hir::HirKind'
182
+ '@variant': 'Alternation'
183
+ '@values': [Hir[]]
184
+ }
185
+
186
+ /**
187
+ * The high-level intermediate representation of a literal.
188
+ *
189
+ * A literal corresponds to 0 or more bytes that should be matched literally.
190
+ * The smart constructors defined on `Hir` will automatically concatenate adjacent
191
+ * literals into one literal, and will even automatically replace empty literals
192
+ * with `HirKind::Empty`.
193
+ */
194
+ export type Literal = {
195
+ '@type': 'struct'
196
+ '@name': 'regex_syntax::hir::Literal'
197
+ '@values': [Uint8Array]
198
+ }
199
+
200
+ /**
201
+ * The high-level intermediate representation of a character class.
202
+ *
203
+ * A character class corresponds to a set of characters. A character is either
204
+ * defined by a Unicode scalar value or a byte. Unicode characters are used by
205
+ * default, while bytes are used when Unicode mode (via the `u` flag) is disabled.
206
+ *
207
+ * A character class, regardless of its character type, is represented by a
208
+ * sequence of non-overlapping non-adjacent ranges of characters.
209
+ *
210
+ * Note that `Bytes` variant may be produced even when it exclusively matches
211
+ * valid UTF-8. This is because a `Bytes` variant represents an intention by the
212
+ * author of the regular expression to disable Unicode mode, which in turn
213
+ * impacts the semantics of case insensitive matching. For example, `(?i)k` and
214
+ * `(?i-u)k` will not match the same set of strings.
215
+ */
216
+ export type Class =
217
+ | ClassUnicodeVariant
218
+ | ClassByteVariant
219
+
220
+ /**
221
+ * A set of characters represented by Unicode scalar values.
222
+ */
223
+ export type ClassUnicodeVariant = {
224
+ '@type': 'enum'
225
+ '@name': 'regex_syntax::hir::Class'
226
+ '@variant': 'Unicode'
227
+ '@values': [ClassUnicode]
228
+ }
229
+
230
+ /**
231
+ * A set of characters represented by arbitrary bytes (one byte per character).
232
+ */
233
+ export type ClassByteVariant = {
234
+ '@type': 'enum'
235
+ '@name': 'regex_syntax::hir::Class'
236
+ '@variant': 'Bytes'
237
+ '@values': [ClassBytes]
238
+ }
239
+
240
+ /**
241
+ * A set of characters represented by Unicode scalar values.
242
+ */
243
+ export type ClassUnicode = {
244
+ '@type': 'struct'
245
+ '@name': 'regex_syntax::hir::ClassUnicode'
246
+
247
+ /** The underlying ranges as a slice. */
248
+ ranges: ClassUnicodeRange[]
249
+ }
250
+
251
+ /**
252
+ * A single range of characters represented by Unicode scalar values.
253
+ *
254
+ * The range is closed. That is, the start and end of the range are included in
255
+ * the range.
256
+ */
257
+ export type ClassUnicodeRange = {
258
+ '@type': 'struct'
259
+ '@name': 'regex_syntax::hir::ClassUnicodeRange'
260
+
261
+ /**
262
+ * Return the start of this range.
263
+ *
264
+ * The start of a range is always less than or equal to the end of the range.
265
+ */
266
+ start: string
267
+
268
+ /**
269
+ * Return the end of this range.
270
+ *
271
+ * The end of a range is always greater than or equal to the start of the range.
272
+ */
273
+ end: string
274
+
275
+ /**
276
+ * The number of codepoints in this range.
277
+ */
278
+ len: number
279
+ }
280
+
281
+ /**
282
+ * A set of characters represented by arbitrary bytes (where one byte corresponds
283
+ * to one character).
284
+ */
285
+ export type ClassBytes = {
286
+ '@type': 'struct'
287
+ '@name': 'regex_syntax::hir::ClassBytes'
288
+
289
+ /** The underlying ranges as a slice. */
290
+ ranges: ClassBytesRange[]
291
+ }
292
+
293
+ /**
294
+ * A single range of characters represented by arbitrary bytes.
295
+ *
296
+ * The range is closed. That is, the start and end of the range are included in
297
+ * the range.
298
+ */
299
+ export type ClassBytesRange = {
300
+ '@type': 'struct'
301
+ '@name': 'regex_syntax::hir::ClassBytesRange'
302
+
303
+ /**
304
+ * The start of this range.
305
+ *
306
+ * The start of a range is always less than or equal to the end of the range.
307
+ */
308
+ start: number
309
+
310
+ /**
311
+ * The end of this range.
312
+ *
313
+ * The end of a range is always greater than or equal to the start of the range.
314
+ */
315
+ end: number
316
+
317
+ /**
318
+ * The number of bytes in this range.
319
+ */
320
+ len: number
321
+ }
322
+
323
+ /**
324
+ * The high-level intermediate representation for a look-around assertion.
325
+ *
326
+ * An assertion match is always zero-length. Also called an “empty match.”
327
+ */
328
+ export type Look =
329
+ | LookStartVariant
330
+ | LookEndVariant
331
+ | LookStartLFVariant
332
+ | LookEndLFVariant
333
+ | LookStartCRLFVariant
334
+ | LookEndCRLFVariant
335
+ | LookWordAsciiVariant
336
+ | LookWordAsciiNegateVariant
337
+ | LookWordUnicodeVariant
338
+ | LookWordUnicodeNegateVariant
339
+ | LookWordStartAsciiVariant
340
+ | LookWordEndAsciiVariant
341
+ | LookWordStartUnicodeVariant
342
+ | LookWordEndUnicodeVariant
343
+ | LookWordStartHalfAsciiVariant
344
+ | LookWordEndHalfAsciiVariant
345
+ | LookWordStartHalfUnicodeVariant
346
+ | LookWordEndHalfUnicodeVariant
347
+
348
+ /**
349
+ * Match the beginning of text. Specifically, this matches at the starting
350
+ * position of the input.
351
+ */
352
+ export type LookStartVariant = {
353
+ '@type': 'enum'
354
+ '@name': 'regex_syntax::hir:Look'
355
+ '@variant': 'Start'
356
+ }
357
+
358
+ /**
359
+ * Match the end of text. Specifically, this matches at the ending position of
360
+ * the input.
361
+ */
362
+ export type LookEndVariant = {
363
+ '@type': 'enum'
364
+ '@name': 'regex_syntax::hir:Look'
365
+ '@variant': 'End'
366
+ }
367
+
368
+ /**
369
+ * Match the beginning of a line or the beginning of text. Specifically, this
370
+ * matches at the starting position of the input, or at the position immediately
371
+ * following a `\n` character.
372
+ */
373
+ export type LookStartLFVariant = {
374
+ '@type': 'enum'
375
+ '@name': 'regex_syntax::hir:Look'
376
+ '@variant': 'StartLF'
377
+ }
378
+
379
+ /**
380
+ * Match the end of a line or the end of text. Specifically, this matches at the
381
+ * end position of the input, or at the position immediately preceding a `\n`
382
+ * character.
383
+ */
384
+ export type LookEndLFVariant = {
385
+ '@type': 'enum'
386
+ '@name': 'regex_syntax::hir:Look'
387
+ '@variant': 'EndLF'
388
+ }
389
+
390
+ /**
391
+ * Match the beginning of a line or the beginning of text. Specifically, this
392
+ * matches at the starting position of the input, or at the position immediately
393
+ * following either a `\r` or `\n` character, but never after a `\r` when a `\n`
394
+ * follows.
395
+ */
396
+ export type LookStartCRLFVariant = {
397
+ '@type': 'enum'
398
+ '@name': 'regex_syntax::hir:Look'
399
+ '@variant': 'StartCRLF'
400
+ }
401
+
402
+ /**
403
+ * Match the end of a line or the end of text. Specifically, this matches at the
404
+ * end position of the input, or at the position immediately preceding a `\r` or
405
+ * `\n` character, but never before a `\n` when a `\r` precedes it.
406
+ */
407
+ export type LookEndCRLFVariant = {
408
+ '@type': 'enum'
409
+ '@name': 'regex_syntax::hir:Look'
410
+ '@variant': 'EndCRLF'
411
+ }
412
+
413
+ /**
414
+ * Match an ASCII-only word boundary. That is, this matches a position where the
415
+ * left adjacent character and right adjacent character correspond to a word and
416
+ * non-word or a non-word and word character.
417
+ */
418
+ export type LookWordAsciiVariant = {
419
+ '@type': 'enum'
420
+ '@name': 'regex_syntax::hir:Look'
421
+ '@variant': 'WordAscii'
422
+ }
423
+
424
+ /**
425
+ * Match an ASCII-only negation of a word boundary.
426
+ */
427
+ export type LookWordAsciiNegateVariant = {
428
+ '@type': 'enum'
429
+ '@name': 'regex_syntax::hir:Look'
430
+ '@variant': 'WordAsciiNegate'
431
+ }
432
+
433
+ /**
434
+ * Match a Unicode-aware word boundary. That is, this matches a position where
435
+ * the left adjacent character and right adjacent character correspond to a word
436
+ * and non-word or a non-word and word character.
437
+ */
438
+ export type LookWordUnicodeVariant = {
439
+ '@type': 'enum'
440
+ '@name': 'regex_syntax::hir:Look'
441
+ '@variant': 'WordUnicode'
442
+ }
443
+
444
+ /**
445
+ * Match a Unicode-aware negation of a word boundary.
446
+ */
447
+ export type LookWordUnicodeNegateVariant = {
448
+ '@type': 'enum'
449
+ '@name': 'regex_syntax::hir:Look'
450
+ '@variant': 'WordUnicodeNegate'
451
+ }
452
+
453
+ /**
454
+ * Match the start of an ASCII-only word boundary. That is, this matches a
455
+ * position at either the beginning of the haystack or where the previous
456
+ * character is not a word character and the following character is a word
457
+ * character.
458
+ */
459
+ export type LookWordStartAsciiVariant = {
460
+ '@type': 'enum'
461
+ '@name': 'regex_syntax::hir:Look'
462
+ '@variant': 'WordStartAscii'
463
+ }
464
+
465
+ /**
466
+ * Match the end of an ASCII-only word boundary. That is, this matches a
467
+ * position at either the end of the haystack orwhere the previous character is
468
+ * a word character and the following character is not a word character.
469
+ */
470
+ export type LookWordEndAsciiVariant = {
471
+ '@type': 'enum'
472
+ '@name': 'regex_syntax::hir:Look'
473
+ '@variant': 'WordEndAscii'
474
+ }
475
+
476
+ /**
477
+ * Match the start of a Unicode word boundary. That is, this matches a position
478
+ * at either the beginning of the haystack or where the previous character is
479
+ * not a word character and the following character is a word character.
480
+ */
481
+ export type LookWordStartUnicodeVariant = {
482
+ '@type': 'enum'
483
+ '@name': 'regex_syntax::hir:Look'
484
+ '@variant': 'WordStartUnicode'
485
+ }
486
+
487
+ /**
488
+ * Match the end of a Unicode word boundary. That is, this matches a position at
489
+ * either the end of the haystack or where the previous character is a word
490
+ * character and the following character is not a word character.
491
+ */
492
+ export type LookWordEndUnicodeVariant = {
493
+ '@type': 'enum'
494
+ '@name': 'regex_syntax::hir:Look'
495
+ '@variant': 'WordEndUnicode'
496
+ }
497
+
498
+ /**
499
+ * Match the start half of an ASCII-only word boundary. That is, this matches a
500
+ * position at either the beginning of the haystack or where the previous
501
+ * character is not a word character.
502
+ */
503
+ export type LookWordStartHalfAsciiVariant = {
504
+ '@type': 'enum'
505
+ '@name': 'regex_syntax::hir::Look',
506
+ '@variant': 'WordStartHalfAscii'
507
+ }
508
+
509
+ /**
510
+ * Match the end half of an ASCII-only word boundary. That is, this matches a
511
+ * position at either the end of the haystack or where the following character
512
+ * is not a word character.
513
+ */
514
+ export type LookWordEndHalfAsciiVariant = {
515
+ '@type': 'enum'
516
+ '@name': 'regex_syntax::hir::Look',
517
+ '@variant': 'WordEndHalfAscii'
518
+ }
519
+
520
+ /**
521
+ * Match the start half of a Unicode word boundary. That is, this matches a
522
+ * position at either the beginning of the haystack or where the previous
523
+ * character is not a word character.
524
+ */
525
+ export type LookWordStartHalfUnicodeVariant = {
526
+ '@type': 'enum'
527
+ '@name': 'regex_syntax::hir::Look',
528
+ '@variant': 'WordStartHalfUnicode'
529
+ }
530
+
531
+ /**
532
+ * Match the end half of a Unicode word boundary. That is, this matches a
533
+ * position at either the end of the haystack or where the following character
534
+ * is not a word character.
535
+ */
536
+ export type LookWordEndHalfUnicodeVariant = {
537
+ '@type': 'enum'
538
+ '@name': 'regex_syntax::hir::Look',
539
+ '@variant': 'WordEndHalfUnicode'
540
+ }
541
+
542
+ /**
543
+ * The high-level intermediate representation of a repetition operator.
544
+ *
545
+ * A repetition operator permits the repetition of an arbitrary sub-expression
546
+ */
547
+ export type Repetition = {
548
+ '@type': 'struct'
549
+ '@name': 'regex_syntax::hir::Repetition'
550
+
551
+ /**
552
+ * The minimum range of the repetition.
553
+ *
554
+ * Note that special cases like `?`, `+` and `*` all get translated into the
555
+ * ranges `{0,1}`, `{1,}` and `{0,}`, respectively.
556
+ *
557
+ * When `min` is zero, this expression can match the empty string regardless
558
+ * of what its sub-expression is.
559
+ */
560
+ min: number
561
+
562
+ /**
563
+ * The maximum range of the repetition.
564
+ *
565
+ * Note that when `max` is `undefined`, `min` acts as a lower bound but where
566
+ * there is no upper bound. For something like `x{5}` where the min and max
567
+ * are equivalent, `min` will be set to `5` and `max` will be set to `5`.
568
+ */
569
+ max?: number
570
+
571
+ /**
572
+ * Whether this repetition operator is greedy or not. A greedy operator will
573
+ * match as much as it can. A non-greedy operator will match as little as it
574
+ * can.
575
+ *
576
+ * Typically, operators are greedy by default and are only non-greedy when a
577
+ * `?` suffix is used, e.g., `(expr)*` is greedy while `(expr)*?` is not.
578
+ * However, this can be inverted via the `U` “ungreedy” flag.
579
+ */
580
+ greedy: boolean
581
+
582
+ /**
583
+ * The expression being repeated.
584
+ */
585
+ sub: Hir
586
+ }
587
+
588
+ /**
589
+ * Represents the capture groups for a single match.
590
+ *
591
+ * Capture groups refer to parts of a regex enclosed in parentheses. They can
592
+ * be optionally named. The purpose of capture groups is to be able to
593
+ * reference different parts of a match based on the original pattern. For
594
+ * example, say you want to match the individual letters in a 5-letter word:
595
+ *
596
+ * ```text
597
+ * (?<first>\w)(\w)(?:\w)\w(?<last>\w)
598
+ * ```
599
+ *
600
+ * This regex has 4 capture groups:
601
+ *
602
+ * * The group at index `0` corresponds to the overall match. It is always
603
+ * present in every match and never has a name.
604
+ * * The group at index `1` with name `first` corresponding to the first
605
+ * letter.
606
+ * * The group at index `2` with no name corresponding to the second letter.
607
+ * * The group at index `3` with name `last` corresponding to the fifth and
608
+ * last letter.
609
+ *
610
+ * Notice that `(?:\w)` was not listed above as a capture group despite it
611
+ * being enclosed in parentheses. That's because `(?:pattern)` is a special
612
+ * syntax that permits grouping but *without* capturing. The reason for not
613
+ * treating it as a capture is that tracking and reporting capture groups
614
+ * requires additional state that may lead to slower searches. So using as few
615
+ * capture groups as possible can help performance. (Although the difference
616
+ * in performance of a couple of capture groups is likely immaterial.)
617
+ *
618
+ * # Example
619
+ *
620
+ * ```typescript
621
+ * import { RRegex } from "rregex"
622
+ *
623
+ * const re = new RRegex("(?<first>\\w)(\\w)(?:\\w)\\w(?<last>\\w)");
624
+ * const caps = re.captures("toady");
625
+ * expect(caps.get[0].value).toBe("toady");
626
+ * expect(caps.name["first"].value).toBe("t");
627
+ * expect(caps.get[2].value).toBe("o");
628
+ * expect(caps.name["last"].value).toBe("y");
629
+ * ```
630
+ */
631
+ export type Captures = {
632
+ get: Match[]
633
+ name: Record<string, Match>
634
+ }
635
+
636
+ /**
637
+ * The high-level intermediate representation for a capturing group.
638
+ *
639
+ * A capturing group always has an index and a child expression. It may also
640
+ * have a name associated with it (e.g., `(?P<foo>\w)`), but it's not necessary.
641
+ *
642
+ * Note that there is no explicit representation of a non-capturing group in a
643
+ * `Hir`. Instead, non-capturing grouping is handled automatically by the
644
+ * recursive structure of the `Hir` itself.
645
+ */
646
+ export type Capture = {
647
+ '@type': 'struct'
648
+ '@name': 'regex_syntax::hir::Capture'
649
+
650
+ /** The capture index of the capture. */
651
+ index: number
652
+
653
+ /** The name of the capture, if it exists. */
654
+ name?: String
655
+
656
+ /** The expression inside the capturing group, which may be empty. */
657
+ sub: Hir
658
+ }
659
+
660
+ /**
661
+ * A compiled regular expression for matching Unicode strings.
662
+ *
663
+ * A `RRegex` can be used to search haystacks, split haystacks into substrings
664
+ * or replace substrings in a haystack with a different substring. All
665
+ * searching is done with an implicit `(?s:.)*?` at the beginning and end of
666
+ * an pattern. To force an expression to match the whole string (or a prefix
667
+ * or a suffix), you must use an anchor like `^` or `$` (or `\A` and `\z`).
668
+ *
669
+ * While this library will handle Unicode strings (whether in the regular
670
+ * expression or in the haystack), all positions returned are **byte
671
+ * offsets**. Every byte offset is guaranteed to be at a Unicode code point
672
+ * boundary. That is, all offsets returned by the `RRegex` API are guaranteed
673
+ * to be ranges that can slice an `Uint8Array` created with a TextEncoder.
674
+ *
675
+ * # Example: slicing over UTF strings
676
+ *
677
+ * ```typescript
678
+ * import { RRegex } from "rregex"
679
+ *
680
+ * const re = new RRegex("ä")
681
+ * const m = re.find("äöü") // { start: 0, end: 2 }
682
+ *
683
+ * const buff = new TextEncoder().encode("äöü")
684
+ * const slice = buff.slice(m.start, m.end)
685
+ * expect(new TextDecoder().decode(slice)).toBe("ä")
686
+ * ```
687
+ *
688
+ * # Example: find the offsets of a US phone number:
689
+ *
690
+ * ```typescript
691
+ * import { RRegex } from "rregex"
692
+ *
693
+ * const re = new RRegex("[0-9]{3}-[0-9]{3}-[0-9]{4}");
694
+ * const m = re.find("phone: 111-222-3333");
695
+ * expect(m.start).toBe(7);
696
+ * expect(m.end).toBe(19);
697
+ * ```
698
+ *
699
+ * @see https://docs.rs/regex/latest/regex/
700
+ */
701
+ export class RRegex {
702
+ free(): void;
703
+ /**
704
+ * Returns the same as is_match, but starts the search at the given offset.
705
+ * The significance of the starting point is that it takes the surrounding
706
+ * context into consideration. For example, the `\A` anchor can only match
707
+ * when `start == 0`.
708
+ *
709
+ * @see https://docs.rs/regex/latest/regex/struct.Regex.html#method.is_match_at
710
+ * @param {string} text - The string against which to match the regular expression
711
+ * @param {number} start - Zero-based index at which to start matching
712
+ * @return {boolean}
713
+ */
714
+ isMatchAt(text: string, start: number): boolean;
715
+ /**
716
+ * Replaces all non-overlapping matches in `text` with the replacement
717
+ * provided. This is the same as calling `replacen` with `limit` set to
718
+ * `0`.
719
+ *
720
+ * See the documentation for `replace` for details on how to access
721
+ * capturing group matches in the replacement string.
722
+ *
723
+ * See the documentation for `replace` for details on how to access capturing group matches in the replacement string.
724
+ * @see https://docs.rs/regex/latest/regex/struct.Regex.html#method.replace_all
725
+ * @param {string} text - The string against which to match the regular expression
726
+ * @param {string} rep - It's a string, it will replace the substring matched by `pattern`.
727
+ * @returns {string}
728
+ */
729
+ replaceAll(text: string, rep: string): string;
730
+ /**
731
+ * Returns a list with all the non-overlapping capture groups matched
732
+ * in `text`. This is operationally the same as `findAll`, except it
733
+ * returns information about capturing group matches.
734
+ *
735
+ * # Example
736
+ *
737
+ * We can use this to find all movie titles and their release years in
738
+ * some text, where the movie is formatted like "'Title' (xxxx)":
739
+ *
740
+ * ```typescript
741
+ * import { RRegex } from "rregex"
742
+ *
743
+ * const re = new RRegex("'(?P<title>[^']+)'\\s+\\((?P<year>\\d{4})\\)")
744
+ * const text = "'Citizen Kane' (1941), 'The Wizard of Oz' (1939), 'M' (1931)."
745
+ * for caps of re.captures_iter(text) {
746
+ * console.log(
747
+ * "Movie:", caps.name["title"].value, ","
748
+ * "Released:", caps.name["year"].value
749
+ * );
750
+ * }
751
+ * // Output:
752
+ * // Movie: Citizen Kane, Released: 1941
753
+ * // Movie: The Wizard of Oz, Released: 1939
754
+ * // Movie: M, Released: 1931
755
+ * ```
756
+ *
757
+ * @see https://docs.rs/regex/latest/regex/struct.Regex.html#method.captures_iter
758
+ * @param {string} text - The string against which to match the regular expression
759
+ * @returns {Captures[]}
760
+ */
761
+ capturesAll(text: string): Captures[];
762
+ /**
763
+ * Returns the number of captures.
764
+ *
765
+ * This includes all named and unnamed groups, including the implicit
766
+ * unnamed group that is always present and corresponds to the entire match.
767
+ *
768
+ * Since the implicit unnamed group is always included in this length, the
769
+ * length returned is guaranteed to be greater than zero.
770
+ *
771
+ * ## Example
772
+ *
773
+ * ```typescript
774
+ * import { RRegex } from "rregex"
775
+ *
776
+ * const re1 = new RRegex("(?P<y>\\d{4})-(?P<m>\\d{2})-(?P<d>\\d{2})")
777
+ * expect(re1.capturesLength()).toEqual(4)
778
+ *
779
+ * const re2 = new RRegex("foo")
780
+ * expect(re2.capturesLength()).toEqual(1)
781
+ *
782
+ * const re3 = new RRegex("(foo)")
783
+ * expect(re3.capturesLength()).toEqual(2)
784
+ *
785
+ * const re4 = new RRegex("(?<a>.(?<b>.))(.)(?:.)(?<c>.)")
786
+ * expect(re4.capturesLength()).toEqual(5)
787
+ *
788
+ * const re5 = new RRegex("[a&&b]")
789
+ * expect(re5.capturesLength()).toEqual(1)
790
+ * ```
791
+ *
792
+ * @see https://docs.rs/regex/latest/regex/struct.Regex.html#method.captures_len
793
+ */
794
+ capturesLength(): number;
795
+ /**
796
+ * Returns a list of the capture names in this regex.
797
+ *
798
+ * @see https://docs.rs/regex/latest/regex/struct.Regex.html#method.capture_names
799
+ */
800
+ captureNames(): (string | null)[];
801
+ /**
802
+ * Returns the end location of a match in the text given.
803
+ *
804
+ * This method may have the same performance characteristics as
805
+ * `isMatch`, except it provides an end location for a match. In
806
+ * particular, the location returned *may be shorter* than the proper end
807
+ * of the leftmost-first match that you would find via `Regex.find`.
808
+ *
809
+ * Note that it is not guaranteed that this routine finds the shortest or
810
+ * "earliest" possible match. Instead, the main idea of this API is that
811
+ * it returns the offset at the point at which the internal regex engine
812
+ * has determined that a match has occurred. This may vary depending on
813
+ * which internal regex engine is used, and thus, the offset itself may
814
+ * change.
815
+ *
816
+ * # Example
817
+ *
818
+ * Typically, `a+` would match the entire first sequence of `a` in some
819
+ * text, but `shortest_match` can give up as soon as it sees the first
820
+ * `a`.
821
+ *
822
+ * ```typescript
823
+ * import { RRegex } from "rregex"
824
+ *
825
+ * const text = "aaaaa"
826
+ * const = new RRegex("a+").shortest_match(text)
827
+ * expect(pos).toBe(1)
828
+ * ```
829
+ *
830
+ * @see https://docs.rs/regex/latest/regex/struct.Regex.html#method.shortest_match
831
+ * @param {string} text - The string against which to match the regular expression
832
+ * @returns {number|undefined}
833
+ */
834
+ shortestMatch(text: string): number | undefined;
835
+ /**
836
+ * Returns the same as `shortest_match`, but starts the search at the
837
+ * given offset.
838
+ *
839
+ * The significance of the starting point is that it takes the surrounding
840
+ * context into consideration. For example, the `\A` anchor can only match
841
+ * when `start == 0`.
842
+ * @see https://docs.rs/regex/latest/regex/struct.Regex.html#method.shortest_match_at
843
+ * @param {string} text - The string against which to match the regular expression
844
+ * @param {number} start - Zero-based index at which to start matching
845
+ * @returns {number|undefined}
846
+ */
847
+ shortestMatchAt(text: string, start: number): number | undefined;
848
+ /**
849
+ * Compiles a regular expression. Once compiled, it can be used repeatedly
850
+ * to search, split or replace text in a string.
851
+ *
852
+ * If an invalid expression is given, then an error is returned.
853
+ */
854
+ constructor(re: string);
855
+ /**
856
+ * Returns the start and end byte range of the leftmost-first match in
857
+ * `text`. If no match exists, then `undefined` is returned.
858
+ *
859
+ * Note that this should only be used if you want to discover the position
860
+ * of the match. Testing the existence of a match is faster if you use
861
+ * `isMatch`.
862
+ *
863
+ * # Example
864
+ *
865
+ * Find the start and end location of the first word with exactly 13
866
+ * Unicode word characters:
867
+ *
868
+ * ```typescript
869
+ * import { RRegex } from "rregex"
870
+ *
871
+ * const text = "I categorically deny having triskaidekaphobia."
872
+ * const m = new RRegex("\\b\\w{13}\\b").find(text)
873
+ * expect(m.start).toBe(2)
874
+ * expect(m.end).toBe(15)
875
+ * ```
876
+ *
877
+ * @see https://docs.rs/regex/latest/regex/struct.Regex.html#method.find
878
+ * @param {string} text - The string against which to match the regular expression
879
+ * @return {Match}
880
+ */
881
+ find(text: string): Match | undefined;
882
+ /**
883
+ * Returns an iterator of substrings of `text` delimited by a match of the
884
+ * regular expression. Namely, each element of the iterator corresponds to
885
+ * text that *isn't* matched by the regular expression.
886
+ *
887
+ * This method will *not* copy the text given.
888
+ *
889
+ * # Example
890
+ *
891
+ * To split a string delimited by arbitrary amounts of spaces or tabs:
892
+ *
893
+ * ```typescript
894
+ * import { RRegex } from "rregex"
895
+ *
896
+ * const re = new RRegex(r"[ \\t]+")
897
+ * const fields = re.split("a b \t c\td e")
898
+ * expect(fields).toEqual(["a", "b", "c", "d", "e"])
899
+ * ```
900
+ *
901
+ * @see https://docs.rs/regex/latest/regex/struct.Regex.html#method.split
902
+ * @param {string} text - The string against which to match the regular expression
903
+ * @returns {string[]}
904
+ */
905
+ split(text: string): string[];
906
+ /**
907
+ * Returns an iterator of at most `limit` substrings of `text` delimited
908
+ * by a match of the regular expression. (A `limit` of `0` will return no
909
+ * substrings.) Namely, each element of the iterator corresponds to text
910
+ * that *isn't* matched by the regular expression. The remainder of the
911
+ * string that is not split will be the last element in the iterator.
912
+ *
913
+ * This method will *not* copy the text given.
914
+ *
915
+ * # Example
916
+ *
917
+ * Get the first two words in some text:
918
+ *
919
+ * ```typescript
920
+ * import { RRegex } from "rregex"
921
+ *
922
+ * const re = new RRegex(r"\\W+")
923
+ * const fields = re.splitn("Hey! How are you?", 3)
924
+ * expect(fields).toEqual(["Hey", "How", "are you?"])
925
+ * ```
926
+ * @see https://docs.rs/regex/latest/regex/struct.Regex.html#method.splitn
927
+ * @param {string} text - The string against which to match the regular expression
928
+ * @param {number} limit - Max number result elements
929
+ * @returns {string[]}
930
+ */
931
+ splitn(text: string, limit: number): string[];
932
+ /**
933
+ * Returns the regular expression into a high level intermediate
934
+ * representation.
935
+ */
936
+ syntax(): Hir;
937
+ /**
938
+ * Returns the same as find, but starts the search at the given
939
+ * offset.
940
+ *
941
+ * The significance of the starting point is that it takes the surrounding
942
+ * context into consideration. For example, the `\A` anchor can only
943
+ * match when `start == 0`.
944
+ *
945
+ * @see https://docs.rs/regex/latest/regex/struct.Regex.html#method.find_at
946
+ * @param {string} text - The string against which to match the regular expression
947
+ * @param {number} start - Zero-based index at which to start matching
948
+ * @returns {Match}
949
+ */
950
+ findAt(text: string, start: number): Match | undefined;
951
+ /**
952
+ * Replaces the leftmost-first match with the replacement provided.
953
+ * The replacement can be a regular string (where `$N` and `$name` are
954
+ * expanded to match capture groups) or a function that takes the matches'
955
+ * `Captures` and returns the replaced string.
956
+ *
957
+ * If no match is found, then a copy of the string is returned unchanged.
958
+ *
959
+ * # Replacement string syntax
960
+ *
961
+ * All instances of `$name` in the replacement text is replaced with the
962
+ * corresponding capture group `name`.
963
+ *
964
+ * `name` may be an integer corresponding to the index of the
965
+ * capture group (counted by order of opening parenthesis where `0` is the
966
+ * entire match) or it can be a name (consisting of letters, digits or
967
+ * underscores) corresponding to a named capture group.
968
+ *
969
+ * If `name` isn't a valid capture group (whether the name doesn't exist
970
+ * or isn't a valid index), then it is replaced with the empty string.
971
+ *
972
+ * The longest possible name is used. e.g., `$1a` looks up the capture
973
+ * group named `1a` and not the capture group at index `1`. To exert more
974
+ * precise control over the name, use braces, e.g., `${1}a`.
975
+ *
976
+ * To write a literal `$` use `$$`.
977
+ *
978
+ * # Examples
979
+ *
980
+ * Note that this function is polymorphic with respect to the replacement.
981
+ * In typical usage, this can just be a normal string:
982
+ *
983
+ * ```typescript
984
+ * import { RRegex } from "rregex"
985
+ *
986
+ * const re = new RRegex("[^01]+")
987
+ * expect(re.replace("1078910", "").toBe("1010")
988
+ * ```
989
+ *
990
+ * Here's the example using this expansion technique with named capture
991
+ * groups:
992
+ *
993
+ * ```typescript
994
+ * import { RRegex } from "rregex"
995
+ *
996
+ * const re = new RRegex("(?P<last>[^,\\s]+),\\s+(?P<first>\\S+)")
997
+ * const result = re.replace("Springsteen, Bruce", "$first $last")
998
+ * expect(result).toBe("Bruce Springsteen")
999
+ * ```
1000
+ *
1001
+ * Note that using `$2` instead of `$first` or `$1` instead of `$last`
1002
+ * would produce the same result. To write a literal `$` use `$$`.
1003
+ *
1004
+ * Sometimes the replacement string requires use of curly braces to
1005
+ * delineate a capture group replacement and surrounding literal text.
1006
+ * For example, if we wanted to join two words together with an
1007
+ * underscore:
1008
+ *
1009
+ * ```typescript
1010
+ * import { RRegex } from "rregex"
1011
+ *
1012
+ * const re = new RRegex("(?P<first>\\w+)\\s+(?P<second>\\w+)")
1013
+ * const result = re.replace("deep fried", "${first}_$second")
1014
+ * expect(result).toBe("deep_fried")
1015
+ * ```
1016
+ *
1017
+ * Without the curly braces, the capture group name `first_` would be
1018
+ * used, and since it doesn't exist, it would be replaced with the empty
1019
+ * string.
1020
+ *
1021
+ * @see https://docs.rs/regex/latest/regex/struct.Regex.html#method.replace
1022
+ * @param {string} text - The string against which to match the regular expression
1023
+ * @param {string} rep - It's a string, it will replace the substring matched by `pattern`.
1024
+ * @returns {string}
1025
+ */
1026
+ replace(text: string, rep: string): string;
1027
+ /**
1028
+ * Returns the capture groups corresponding to the leftmost-first
1029
+ * match in `text`. Capture group `0` always corresponds to the entire
1030
+ * match. If no match is found, then `undefined` is returned.
1031
+ *
1032
+ * You should only use `captures` if you need access to the location of
1033
+ * capturing group matches. Otherwise, `find` is faster for discovering
1034
+ * the location of the overall match.
1035
+ *
1036
+ * # Examples
1037
+ *
1038
+ * Say you have some text with movie names and their release years,
1039
+ * like "'Citizen Kane' (1941)". It'd be nice if we could search for text
1040
+ * looking like that, while also extracting the movie name and its release
1041
+ * year separately.
1042
+ *
1043
+ * ```typescript
1044
+ * import { RRegex } from "rregex"
1045
+ *
1046
+ * const re = new RRegex("'([^']+)'\\s+\\((\\d{4})\)")
1047
+ * const text = "Not my favorite movie: 'Citizen Kane' (1941)."
1048
+ * const caps = re.captures(text)
1049
+ * expect(caps.get[1].value).toBe("Citizen Kane")
1050
+ * expect(caps.get[2].value).toBe("1941")
1051
+ * expect(caps.get[0].value).toBe("'Citizen Kane' (1941)")
1052
+ * ```
1053
+ *
1054
+ * Note that the full match is at capture group `0`. Each subsequent
1055
+ * capture group is indexed by the order of its opening `(`.
1056
+ *
1057
+ * We can make this example a bit clearer by using *named* capture groups:
1058
+ *
1059
+ * ```typescript
1060
+ * import { RRegex } from "rregex"
1061
+ *
1062
+ * const re = new RRegex("'(?P<title>[^']+)'\\s+\\((?P<year>\\d{4})\)")
1063
+ * const text = "Not my favorite movie: 'Citizen Kane' (1941)."
1064
+ * const caps = re.captures(text)
1065
+ * expect(caps.name["title"].value).toBe("Citizen Kane")
1066
+ * expect(caps.name["year"].value).toBe("1941")
1067
+ * expect(caps.get[0].value).toBe("'Citizen Kane' (1941)")
1068
+ * ```
1069
+ *
1070
+ * @see https://docs.rs/regex/latest/regex/struct.Regex.html#method.captures
1071
+ * @param {string} text - The string against which to match the regular expression
1072
+ * @returns {Captures|undefined}
1073
+ */
1074
+ captures(text: string): Captures | undefined;
1075
+ /**
1076
+ * Returns an array for each successive non-overlapping match in `text``,
1077
+ * returning the start and end byte indices with respect to `text`.
1078
+ *
1079
+ * # Example
1080
+ *
1081
+ * Find the start and end location of every word with exactly 13 Unicode
1082
+ * word characters:
1083
+ *
1084
+ * ```typescript
1085
+ * import { RRegex } from "rregex"
1086
+ *
1087
+ * const text = "Retroactively relinquishing remunerations is reprehensible."
1088
+ * const matches = new RRegex("\\b\\w{13}\\b").findAll(text)
1089
+ * ```
1090
+ *
1091
+ * @see https://docs.rs/regex/latest/regex/struct.Regex.html#method.find_iter
1092
+ * @param {string} text - The string against which to match the regular expression
1093
+ * @returns {Match}
1094
+ */
1095
+ findAll(text: string): Match[];
1096
+ /**
1097
+ * Returns true if and only if there is a match for the regex in the
1098
+ * string given.
1099
+ *
1100
+ * It is recommended to use this method if all you need to do is test
1101
+ * a match, since the underlying matching engine may be able to do less
1102
+ * work.
1103
+ *
1104
+ * # Example
1105
+ *
1106
+ * Test if some text contains at least one word with exactly 13
1107
+ * Unicode word characters:
1108
+ *
1109
+ * ```typescript
1110
+ * import { RRegex } from "rregex"
1111
+ *
1112
+ * const text = "I categorically deny having triskaidekaphobia."
1113
+ * expect(new RRegex("\\b\\w{13}\\b").is_match(text)).toBe(true)
1114
+ * ```
1115
+ *
1116
+ * @see https://docs.rs/regex/latest/regex/struct.Regex.html#method.is_match
1117
+ * @param {string} text - The string against which to match the regular expression
1118
+ * @return {boolean}
1119
+ */
1120
+ isMatch(text: string): boolean;
1121
+ /**
1122
+ * Replaces at most `limit` non-overlapping matches in `text` with the
1123
+ * replacement provided. If `limit` is 0, then all non-overlapping matches
1124
+ * are replaced.
1125
+ *
1126
+ * See the documentation for `replace` for details on how to access
1127
+ * capturing group matches in the replacement string.
1128
+ *
1129
+ * @see https://docs.rs/regex/latest/regex/struct.Regex.html#method.replacen
1130
+ * @param {string} text - The string against which to match the regular expression
1131
+ * @param {number} limit - Max number of replacement
1132
+ * @param {string} rep - It's a string, it will replace the substring matched by `pattern`.
1133
+ * @returns {string}
1134
+ */
1135
+ replacen(text: string, limit: number, rep: string): string;
1136
+ /**
1137
+ * Returns a string representing the regular expression
1138
+ */
1139
+ toString(): string;
1140
+ }
1141
+ /**
1142
+ * Match multiple (possibly overlapping) regular expressions in a single scan.
1143
+ * A regex set corresponds to the union of two or more regular expressions.
1144
+ *
1145
+ * That is, a regex set will match text where at least one of its constituent
1146
+ * regular expressions matches. A regex set as its formulated here provides a
1147
+ * touch more power: it will also report which regular expressions in the set match.
1148
+ * Indeed, this is the key difference between regex sets and a single `Regex`
1149
+ * with many alternates, since only one alternate can match at a time.
1150
+ *
1151
+ * @see https://docs.rs/regex/latest/regex/struct.RegexSet.html#method.empty
1152
+ */
1153
+ export class RRegexSet {
1154
+ free(): void;
1155
+ /**
1156
+ * Create a new regex set with the given regular expressions.
1157
+ *
1158
+ * This takes an of strings, if any item in the list is not a valid regular
1159
+ * expressions, then an error is returned.
1160
+ *
1161
+ * # Example
1162
+ *
1163
+ * Create a new regex set from an iterator of strings:
1164
+ *
1165
+ * ```typescript
1166
+ * import { RegexSet } from "rregex"
1167
+ *
1168
+ * const set = new RegexSet(["\\w+", "\\d+"])
1169
+ * expect(set.is_match("foo")).toBe(true)
1170
+ * ```
1171
+ */
1172
+ constructor(list: Array<any>);
1173
+ /**
1174
+ * Returns the set of regular expressions that match in the given text.
1175
+ *
1176
+ * The set returned contains the index of each regular expression that
1177
+ * matches in the given text. The index is in correspondence with the
1178
+ * order of regular expressions given to `RegexSet`'s constructor.
1179
+ *
1180
+ * The set can also be used to iterate over the matched indices.
1181
+ *
1182
+ * Note that as with searches using `Regex`, the expression is unanchored
1183
+ * by default. That is, if the regex does not start with `^` or `\A`, or
1184
+ * end with `$` or `\z`, then it is permitted to match anywhere in the
1185
+ * text.
1186
+ *
1187
+ * # Example
1188
+ *
1189
+ * Tests which regular expressions match the given text:
1190
+ *
1191
+ * ```typescript
1192
+ * import { RegexSet } from "rregex"
1193
+ *
1194
+ * const set = new RegexSet([
1195
+ * "\\w+",
1196
+ * "\\d+",
1197
+ * "\\pL+",
1198
+ * "foo",
1199
+ * "bar",
1200
+ * "barfoo",
1201
+ * "foobar",
1202
+ * ])
1203
+ * const matches = set.matches("foobar")
1204
+ * expect(matches).toBe([0, 2, 3, 4, 6])
1205
+ * ```
1206
+ *
1207
+ * @see https://docs.rs/regex/latest/regex/struct.RegexSet.html#method.matches
1208
+ * @param {string} text - The string against which to match the regular expression
1209
+ * @return {number[]}
1210
+ */
1211
+ matches(text: string): number[];
1212
+ /**
1213
+ * Returns true if and only if one of the regexes in this set matches
1214
+ * the text given.
1215
+ *
1216
+ * This method should be preferred if you only need to test whether any
1217
+ * of the regexes in the set should match, but don't care about *which*
1218
+ * regexes matched. This is because the underlying matching engine will
1219
+ * quit immediately after seeing the first match instead of continuing to
1220
+ * find all matches.
1221
+ *
1222
+ * Note that as with searches using `Regex`, the expression is unanchored
1223
+ * by default. That is, if the regex does not start with `^` or `\A`, or
1224
+ * end with `$` or `\z`, then it is permitted to match anywhere in the
1225
+ * text.
1226
+ *
1227
+ * # Example
1228
+ *
1229
+ * Tests whether a set matches some text:
1230
+ *
1231
+ * ```typescript
1232
+ * import { RegexSet } from "rregex"
1233
+ *
1234
+ * const set = new RegexSet(["\\w+", "\\d+"])
1235
+ * expect(set.is_match("foo")).toBe(true)
1236
+ * expect(!set.is_match("☃")).toBe(false)
1237
+ * ```
1238
+ *
1239
+ * @see https://docs.rs/regex/latest/regex/struct.RegexSet.html#method.is_match
1240
+ * @param {string} text - The string against which to match the regular expression
1241
+ * @return {boolean}
1242
+ */
1243
+ isMatch(text: string): boolean;
1244
+ }
1245
+
1246
+ /** Build metadata */
1247
+ export const metadata: {
1248
+ "name": "rregex",
1249
+ "description": "Rust Regex binding for Javascript",
1250
+ "authors": [
1251
+ "Fede Ramirez <i@2fd.me>"
1252
+ ],
1253
+ "homepage": "http://rregex.dev",
1254
+ "repository": "https://github.com/2fd/rregex",
1255
+ "regex": "1.10.6",
1256
+ "regex-syntax": "0.8.4"
1257
+ }