---
name: "JavaScript::QuickJS::RegExp"
section: "3pm"
platform: "linux"
package: "libjavascript-quickjs-perl"
version: "0.21-2+b1"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/JavaScript::QuickJS::RegExp"
---

# JavaScript::QuickJS::RegExp(3pm)

JavaScript \`RegExp\` in Perl

## NAME

JavaScript::QuickJS::RegExp - JavaScript \`RegExp\` in Perl

## SYNOPSIS

```
    my $regexp = JavaScript::QuickJS->new()->eval("/foo/");
    if ($regexp->test('fo')) {
        # This won’t run because test() will return falsy.
    }
```

## DESCRIPTION

This class represents a JavaScript RegExp \<https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global\_Objects/RegExp\> instance in Perl.

This class is not instantiated directly.

## METHODS

The following methods correspond to their JS equivalents:

- •

  `exec()`

- •

  `test()`

In addition, the following methods return their corresponding JS property:

- •

  `flags()`

- •

  `dotAll()`

- •

  `global()`

- •

  `hasIndices()`

- •

  `ignoreCase()`

- •

  `multiline()`

- •

  `source()`

- •

  `sticky()`

- •

  `unicode()`

- •

  `lastIndex()`
