# @comunica/actor-function-factory-term-replace

> A term-replace function-factory actor

Latest version **5.3.0** (published 2026-07-10) · MIT license · 0 weekly downloads

## Install

```sh
npm install @comunica/actor-function-factory-term-replace
pnpm add @comunica/actor-function-factory-term-replace
yarn add @comunica/actor-function-factory-term-replace
bun add @comunica/actor-function-factory-term-replace
```

## Health

**Score 55/100 (C)** — status: active.

Positive: no vulnerabilities; recently updated; high maintenance score.

Warnings: low downloads; no types; no esm support.

## Facts

| | |
|---|---|
| Version | 5.3.0 |
| Published | 2026-07-10 |
| First published | 2024-10-08 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 587 |
| Maintainers | joachimvh, rubensworks, rubenverborgh, dexagod, jeswr |
| Keywords | comunica, actor, function-factory, term-function-replace |

## Links

- npm: https://www.npmjs.com/package/@comunica/actor-function-factory-term-replace
- Repository: https://github.com/comunica/comunica
- Homepage: https://comunica.dev/
- Issues: https://github.com/comunica/comunica/issues
- npm.io page: https://npm.io/package/@comunica/actor-function-factory-term-replace

## Recent versions

- 5.3.0 (latest) — 2026-07-10
- 4.4.2-alpha.49.0 (next) — 2025-10-22
- 5.2.3 — 2026-05-26
- 5.2.2 — 2026-05-03
- 5.2.0 — 2026-04-14
- 5.1.3 — 2026-01-30
- 5.1.0 — 2026-01-16
- 5.0.3 — 2026-01-12
- 5.0.2 — 2026-01-12
- 5.0.0 — 2026-01-08
- 4.5.0 — 2025-11-18
- 4.4.1 — 2025-09-25
- 4.4.0 — 2025-09-17
- 4.2.0 — 2025-04-29
- 4.1.0 — 2025-02-11
- … 4 more at https://npm.io/package/@comunica/actor-function-factory-term-replace/versions

## README

# Comunica Term Function Replace Function Factory Actor

[![npm version](https://badge.fury.io/js/%40comunica%2Factor-function-factory-term-function-replace.svg)](https://www.npmjs.com/package/@comunica/actor-function-factory-term-replace)

A [function factory](https://github.com/comunica/comunica/tree/master/packages/bus-function-factory) actor
that constructs a [term function](https://github.com/comunica/comunica/tree/master/packages/bus-function-factory/lib/ActorFunctionFactory.ts)
capable of evaluating the [Replace](https://www.w3.org/TR/sparql11-query/#func-replace) function.
The regex evaluation uses the JavaScript regex engine in 'unicode-mode'
thereby eliminating [Annex B](https://262.ecma-international.org/6.0/#sec-regular-expressions-patterns) behavior.
The `x` and `q` flag not present in the JS engine are implemented by preprocessing of the pattern,
following the implementation provided by [actor-function-factory-term-regex](https://github.com/comunica/comunica/tree/master/packages/actor-function-factory-term-regex).
As a result of using the JS regex engine, the bundle size of this package is small,
but some non-spec compliant edge cases are present.
Examples are the skipped tests in [op.replace-test.ts](https://github.com/comunica/comunica/blob/master/packages/actor-function-factory-term-replace/test/op.replace-test.ts).

This module is part of the [Comunica framework](https://github.com/comunica/comunica),
and should only be used by [developers that want to build their own query engine](https://comunica.dev/docs/modify/).

[Click here if you just want to query with Comunica](https://comunica.dev/docs/query/).

## Install

```bash
$ yarn add @comunica/actor-function-factory-term-replace
```

## Configure

After installing, this package can be added to your engine's configuration as follows:
```text
{
  "@context": [
    ...
    "https://linkedsoftwaredependencies.org/bundles/npm/@comunica/actor-function-factory-term-replace/^5.0.0/components/context.jsonld"
  ],
  "actors": [
    ...
    {
      "@id": "urn:comunica:default:function-factory/actors#term-function-replace",
      "@type": "ActorFunctionFactoryTermReplace"
    }
  ]
}
```

---
_Source: https://npm.io/package/@comunica/actor-function-factory-term-replace · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
