サンプル
regenerate 1.4.2: create regular expression character classes from code points and ranges with regenerate
検証済みサンプル — npm regenerate 1.4.2: create regular expression character classes from code points and ranges with regenerate. node 22 · linux alpine/x64 · docker…
sha256:e252dc0549d10fccbb994d6131997e90fc4c83c26c7c0f2c21880a6497451ce8
このネットワークが提供するのは一つだけです。ビルドされるサンプル。サンドボックスで実行し、署名済みの受領証を保管します。等級はつけず、何も保証しません — 同じコードがあなたの環境でビルドされるかは測定していません。
合格した契約受領証を提出した異なる署名鍵の数です。1 なら作者だけ、2 以上なら他の誰かもビルドしています。鍵は自己生成で背後に登録された身元がないため、数えているのは人ではなく鍵です。
MIT-0
実行証拠
宣言された環境と署名済みの実行を分けてあります。このサンプルが何をどこで実行したかをそのまま確認できます。
- 証拠の基準
- 署名済みコントラクト合格
- 検証レシート
- 1
- ビルドした署名鍵
- 1
宣言された環境
linux 24 · ubuntu · glibc 2.39 x64 npm
検証実行環境
| 環境 | コントラクト | ステージ | 実行日 |
|---|---|---|---|
| node 22 · linux alpine/x64 · docker ed25519:c1973797be207ac4 | PASS | compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS CONTAINER_RUN · node-typescript@1node:22-alpine@sha256:c610fcdfb1d5… |
2026-08-27 |
ケース
HOW- ゴール
- create regular expression character classes from code points and ranges with regenerate
- パッケージ
- シンボル
-
- regenerate
- regenerate.prototype.add
- regenerate.prototype.addRange
- regenerate.prototype.toRegExp
- regenerate.prototype.toString
- 作成日
- 2026-08-27T20:47:08Z
コントラクト
- regenerate initializes a set and accepts variable arguments of characters or code points
- regenerate.prototype.add adds code points, character strings, and numbers to the character set
- regenerate.prototype.addRange adds contiguous ranges of unicode code points
- regenerate.prototype.toString serializes the character set into an optimized regular expression character class pattern
- regenerate.prototype.toRegExp compiles the set into a RegExp instance with optional flags to match target strings
ファイル
- PROMPT.md
- csx.json
- package-lock.json
- package.json
- spec.json
- test/contract.mjs
ソース
Clean-room public code sample — generation instructions
Write a brand-new, minimal, self-contained code sample in this clean-room directory.
Do not copy, paraphrase, or reference any existing project source. Work only from this spec.
A csx.json manifest scaffold already exists. Do not recreate it from memory. Preserve its case.goal, packages and symbols; fill its empty case.contract with exact assertions and correct its environment, commands and verifierAdapter for the files you generate.
Goal: create regular expression character classes from code points and ranges with regenerate
Kind: HOW
Use EXACTLY these public packages and versions:
- pkg:npm/regenerate@1.4.2
Demonstrate these symbols/APIs:
- regenerate
- regenerate.prototype.add
- regenerate.prototype.addRange
- regenerate.prototype.toRegExp
- regenerate.prototype.toString
Rules:
- One focused purpose; the smallest project that proves the goal.
- Include a contract test (test/contract.*) that runs OFFLINE and exits 0 exactly when the goal behavior works.
- Pin every dependency with a lockfile so resolution is reproducible.
- No secrets, credentials, or tokens. No real URLs (only example.com or localhost). No absolute paths.
- No personal names, emails, company names, or project identifiers of any kind.
- No binaries and no generated output (node_modules, dist, target, venv, .git, .env).
- Keep it under 200 files and 256KB packed.
{"case":{"caseId":"case:sha256:1ea1cde88ae058444312dc227b02b90b580d48ee71f00b6887c2df062bb44655","contract":["regenerate initializes a set and accepts variable arguments of characters or code points","regenerate.prototype.add adds code points, character strings, and numbers to the character set","regenerate.prototype.addRange adds contiguous ranges of unicode code points","regenerate.prototype.toString serializes the character set into an optimized regular expression character class pattern","regenerate.prototype.toRegExp compiles the set into a RegExp instance with optional flags to match target strings"],"goal":"create regular expression character classes from code points and ranges with regenerate","kind":"HOW","packages":["pkg:npm/regenerate@1.4.2"],"schemaVersion":1,"symbols":["regenerate","regenerate.prototype.add","regenerate.prototype.addRange","regenerate.prototype.toRegExp","regenerate.prototype.toString"]},"contractCommand":["node","test/contract.mjs"],"environment":{"arch":"x64","distro":"ubuntu","ecosystem":"npm","libc":"glibc","libcVersion":"2.39","os":"linux","osVersionBucket":"24","packageManager":"npm","schemaVersion":1},"license":"MIT-0","packages":["pkg:npm/regenerate@1.4.2"],"schemaVersion":1,"subject":"pkg:npm/regenerate@1.4.2","symbols":["regenerate","regenerate.prototype.add","regenerate.prototype.addRange","regenerate.prototype.toRegExp","regenerate.prototype.toString"],"verifierAdapter":"node-typescript@1"}
{
"name": "regenerate-sample",
"version": "1.0.0",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "regenerate-sample",
"version": "1.0.0",
"dependencies": {
"regenerate": "1.4.2"
}
},
"node_modules/regenerate": {
"version": "1.4.2",
"resolved": "https://registry.npmjs.org/regenerate/-/regenerate-1.4.2.tgz",
"integrity": "sha512-zrceR/XhGYU/d/opr2EKO7aRHUeiBI8qjtfHqADTwZd6Szfy16la6kqD0MIUs5z5hx6AaKa+PixpPrR289+I0A==",
"license": "MIT"
}
}
}
{
"name": "regenerate-sample",
"version": "1.0.0",
"private": true,
"type": "module",
"description": "Clean-room verification for regenerate",
"dependencies": {
"regenerate": "1.4.2"
}
}
{
"schemaVersion": 1,
"goal": "create regular expression character classes from code points and ranges with regenerate",
"kind": "HOW",
"packages": [
"pkg:npm/regenerate@1.4.2"
],
"symbols": [
"regenerate",
"regenerate.prototype.add",
"regenerate.prototype.addRange",
"regenerate.prototype.toRegExp",
"regenerate.prototype.toString"
]
}
import assert from 'node:assert';
import regenerate from 'regenerate';
// 1. regenerate initializes a set and accepts variable arguments of characters or code points
const set1 = regenerate(0x61, 'b');
assert.strictEqual(typeof set1.add, 'function');
assert.strictEqual(typeof set1.addRange, 'function');
assert.strictEqual(typeof set1.toString, 'function');
assert.strictEqual(typeof set1.toRegExp, 'function');
assert.strictEqual(set1.contains(0x61), true);
assert.strictEqual(set1.contains(0x62), true);
assert.strictEqual(set1.contains(0x63), false);
// 2. regenerate.prototype.add adds code points, character strings, and numbers to the character set
const set2 = regenerate().add('x', 0x79, 'z');
assert.strictEqual(set2.contains(0x78), true);
assert.strictEqual(set2.contains(0x79), true);
assert.strictEqual(set2.contains(0x7A), true);
assert.strictEqual(set2.contains(0x61), false);
// 3. regenerate.prototype.addRange adds contiguous ranges of unicode code points
const set3 = regenerate().addRange(0x30, 0x39).addRange(0x41, 0x46);
assert.strictEqual(set3.contains(0x30), true);
assert.strictEqual(set3.contains(0x35), true);
assert.strictEqual(set3.contains(0x39), true);
assert.strictEqual(set3.contains(0x41), true);
assert.strictEqual(set3.contains(0x46), true);
assert.strictEqual(set3.contains(0x47), false);
// 4. regenerate.prototype.toString serializes the character set into an optimized regular expression character class pattern
const set4 = regenerate().addRange(0x30, 0x39).add('a', 'b', 'c');
assert.strictEqual(set4.toString(), '[0-9a-c]');
const set4Solo = regenerate('a');
assert.strictEqual(set4Solo.toString(), 'a');
// 5. regenerate.prototype.toRegExp compiles the set into a RegExp instance with optional flags to match target strings
const set5 = regenerate().addRange(0x30, 0x39).add('a');
const re = set5.toRegExp('i');
assert.ok(re instanceof RegExp);
assert.strictEqual(re.flags, 'i');
assert.strictEqual(re.test('5'), true);
assert.strictEqual(re.test('a'), true);
assert.strictEqual(re.test('A'), true);
assert.strictEqual(re.test('z'), false);
console.log('Contract passed');
オリジンシーダー
匿名