| 1 | package JavaScript::QuickJS::RegExp; | ||
| 2 | |||
| 3 | use strict; | ||
| 4 | use warnings; | ||
| 5 | |||
| 6 | =encoding utf-8 | ||
| 7 | |||
| 8 | =head1 NAME | ||
| 9 | |||
| 10 | JavaScript::QuickJS::RegExp | ||
| 11 | |||
| 12 | =head1 SYNOPSIS | ||
| 13 | |||
| 14 | my $regexp = JavaScript::QuickJS->new()->eval("/foo/"); | ||
| 15 | |||
| 16 | if ($regexp->test('fo')) { | ||
| 17 | # This won’t run because test() will return falsy. | ||
| 18 | } | ||
| 19 | |||
| 20 | =head1 DESCRIPTION | ||
| 21 | |||
| 22 | This class represents a JavaScript | ||
| 23 | L<RegExp|https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp> | ||
| 24 | instance in Perl. | ||
| 25 | |||
| 26 | This class is not instantiated directly. | ||
| 27 | |||
| 28 | =head1 METHODS | ||
| 29 | |||
| 30 | The following methods correspond to their JS equivalents: | ||
| 31 | |||
| 32 | =over | ||
| 33 | |||
| 34 | =item * C<exec()> | ||
| 35 | |||
| 36 | =item * C<test()> | ||
| 37 | |||
| 38 | =back | ||
| 39 | |||
| 40 | In addition, the following methods return their corresponding JS property: | ||
| 41 | |||
| 42 | =over | ||
| 43 | |||
| 44 | =item * C<flags()> | ||
| 45 | |||
| 46 | =item * C<dotAll()> | ||
| 47 | |||
| 48 | =item * C<global()> | ||
| 49 | |||
| 50 | =item * C<hasIndices()> | ||
| 51 | |||
| 52 | =item * C<ignoreCase()> | ||
| 53 | |||
| 54 | =item * C<multiline()> | ||
| 55 | |||
| 56 | =item * C<source()> | ||
| 57 | |||
| 58 | =item * C<sticky()> | ||
| 59 | |||
| 60 | =item * C<unicode()> | ||
| 61 | |||
| 62 | =item * C<lastIndex()> | ||
| 63 | |||
| 64 | =back | ||
| 65 | |||
| 66 | =cut | ||
| 67 | |||
| 68 | 1; |