{"id":25316036,"url":"https://github.com/segevfiner/node-pcre2","last_synced_at":"2026-03-05T16:02:44.394Z","repository":{"id":277234946,"uuid":"930380601","full_name":"segevfiner/node-pcre2","owner":"segevfiner","description":"Node-API bindings to PCRE2","archived":false,"fork":false,"pushed_at":"2026-02-22T23:10:43.000Z","size":327,"stargazers_count":3,"open_issues_count":4,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-02-23T04:12:22.377Z","etag":null,"topics":["napi","node-addon-api","node-api","pcre2","regex","regexp"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/@segevfiner/pcre2","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/segevfiner.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-02-10T14:45:06.000Z","updated_at":"2026-02-22T23:10:47.000Z","dependencies_parsed_at":"2025-07-19T17:10:36.768Z","dependency_job_id":"623f8ffe-e4ed-4186-8dde-6ed2a45806bd","html_url":"https://github.com/segevfiner/node-pcre2","commit_stats":null,"previous_names":["segevfiner/node-pcre2"],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/segevfiner/node-pcre2","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/segevfiner%2Fnode-pcre2","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/segevfiner%2Fnode-pcre2/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/segevfiner%2Fnode-pcre2/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/segevfiner%2Fnode-pcre2/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/segevfiner","download_url":"https://codeload.github.com/segevfiner/node-pcre2/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/segevfiner%2Fnode-pcre2/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30134574,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-05T15:35:27.018Z","status":"ssl_error","status_checked_at":"2026-03-05T15:35:23.768Z","response_time":93,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["napi","node-addon-api","node-api","pcre2","regex","regexp"],"created_at":"2025-02-13T18:53:53.698Z","updated_at":"2026-03-05T16:02:44.387Z","avatar_url":"https://github.com/segevfiner.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# @segevfiner/pcre2\n[![NPM Version](https://img.shields.io/npm/v/%40segevfiner%2Fpcre2)](https://www.npmjs.com/package/@segevfiner/pcre2)\n[![CI](https://github.com/segevfiner/node-pcre2/actions/workflows/ci.yml/badge.svg)](https://github.com/segevfiner/node-pcre2/actions/workflows/ci.yml)\n\nNode-API bindings to [PCRE2](https://pcre2project.github.io/pcre2/).\n\nInstall using:\n```sh\nnpm/yarn/pnpm add @segevfiner/pcre2\n```\n\n## Usage\n\nCreate an instance using the `PCRE2` constructor or `pcre2` tagged template literal:\n```ts\nimport { PCRE2, pcre2 } from \"pcre2\";\n\nconst re1 = new PCRE2(\"a(b)c\");\nconst re2 = pcre2`a(b)c`;\n\nconst re3 = new PCRE2(\"foo(bar)+\", \"g\");\nconst re4 = pcre2(\"g\")`foo(bar)+`; // With flags\n```\n\nThe template literal can be called and then used a a literal to add flags as\nshown above (e.g. `` pcre2(\"g\")`foo(bar)+` ``).\n\nThe `PCRE2` object has the same interface as the builtin JavaScript [`RegExp`]\nobject, and can be used with the string methods taking a `RegExp` as well (Such\nas `match`, `matchAll`, `replace`, etc.).\n\nBy default, the library enables a few PCRE2 options to more closely behave like\nJavaScript's builtin `RegExp`, namely: `PCRE2_ALT_BSUX`, `PCRE2_DOLLAR_ENDONLY`, `PCRE2_MATCH_UNSET_BACKREF`, `PCRE2_EXTRA_ALT_BSUX`, and the behavior on empty matches is the one specified by JavaScript rather than `pcre2grep`, this can be toggled using the `p` (`pcre2Mode`) flag.\n\nAdditional flags supported by PCRE2 are supported (See [PCRE2 docs] for details):\n* `x` (`extended`) - Ignores whitespace in the pattern and allows comments.\n* `xx` (`extendedMore`) - Like `extended`, but also ignores unescaped\n  space and horizontal tab in character classes.\n* `n` (`noAutoCapture`) - Disables the use of numbered capturing groups in the pattern.\n* `aD` (`asciiBsd`) - Forces `\\d` to match only ASCII digits even with `(*UCP)`.\n* `aS` (`asciiBss`) - Forces `\\s` to match only ASCII space characters even with `(*UCP)`.\n* `aW` (`asciiBsw`) - Forces `\\w` to match only ASCII word characters even with `(*UCP)`.\n* `aT` (`asciiDigit`) - Forces the POSIX character classes `[:digit:]` and `[:xdigit:]` to match only ASCII digits even with `(*UCP)`.\n* `aP` (`asciiPosix`) - Forces all the POSIX character classes, including `[:digit:]` and `[:xdigit:]`, to match only ASCII characters even with `(*UCP)`.\n* `a` - Enables all the ascii options above.\n* `r` (`caselessRestrict`) - Disables recognition of case-equivalences that cross the ASCII/non-ASCII boundary when `unicode` or `(*UCP)` is enabled.\n* `J` (`dupnames`) - Allows duplicate capture group names.\n* `U` (`ungreedy`) - Inverts the \"greediness\" of the quantifiers so that they are not greedy by default, but become greedy if followed by \"?\".\n* `p` (`pcre2Mode`) - Disables JavaScript compatibility options/behaviors to behave like PCRE2.\n\n[`RegExp`]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp\n[PCRE2 docs]: https://pcre2project.github.io/pcre2/doc/\n\n## License\nBSD-3-Clause.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsegevfiner%2Fnode-pcre2","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsegevfiner%2Fnode-pcre2","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsegevfiner%2Fnode-pcre2/lists"}