CLAUDE WATERMARK REMOVER · PRACTICAL TEST
Can cleaning change both matchAll results and their indices?
Yes. Our marked ID7 initially fails /ID(\d)/g while ID8 matches at index 5. Cleaning restores ID7 at 0 and moves ID8 to 4. A supplementary prefix confirms indices use UTF-16 units.
Open the Claude text cleaner · Full measured data
Measured inputs and outputs
These are locally constructed test strings, not evidence that Claude inserts these characters. We executed the saved homepage script snapshot with a minimal DOM harness and compared exact strings. The invisible-checkbox state and dash mode appear in each row. The observations below test this page's specific question. Destination observations run independently on the exact input and cleaned strings in the recorded Node runtime. We make no detector-score or statistical-watermark removal claim.
| Fixture and mode | Input string and code points | Output and cleaner status | Observed before / after |
|---|---|---|---|
| Marked name before suffix direct string / keep / invisible true | "ID7 ID8"U+0049 U+0044 U+200B U+0037 U+0020 U+0049 U+0044 U+0038 | "ID7 ID8"Removed 1 invisible character | {"matches":[{"text":"ID8","digit":"8","index":5}]}{"matches":[{"text":"ID7","digit":"7","index":0},{"text":"ID8","digit":"8","index":4}]} |
| Plain names direct string / keep / invisible true | "ID7 ID8"U+0049 U+0044 U+0037 U+0020 U+0049 U+0044 U+0038 | "ID7 ID8"No selected invisible characters found | {"matches":[{"text":"ID7","digit":"7","index":0},{"text":"ID8","digit":"8","index":4}]}{"matches":[{"text":"ID7","digit":"7","index":0},{"text":"ID8","digit":"8","index":4}]} |
| Supplementary prefix direct string / keep / invisible true | "😀 ID7"U+1F600 U+0020 U+0049 U+0044 U+0037 | "😀 ID7"No selected invisible characters found | {"matches":[{"text":"ID7","digit":"7","index":3}]}{"matches":[{"text":"ID7","digit":"7","index":3}]} |
| No identifier direct string / keep / invisible true | "none"U+006E U+006F U+006E U+0065 | "none"No selected invisible characters found | {"matches":[]}{"matches":[]} |
A repaired token adds a result and shifts another
The first fixture contains ID, a selected marker and seven, followed by a space and ID8. Before deletion, only the second token matches the fixed expression and its index is five. After deletion, the observer records ID7 with captured digit seven at zero and ID8 with digit eight at four. The plain reference already has both matches. A supplementary smile before ID7 yields index three, counting the smile as two UTF-16 units plus a space. The no-identifier control yields an empty list. Captures and full matched strings accompany every index so the new match is distinguishable from the shifted existing one.
This iterator answers a lexical matching question
We spread the matchAll iterator into an array using the global expression /ID(\d)/g, then retain each full match, first capture and index. These are invented labels rather than a real identifier specification. The earlier sentence-offset article uses linguistic segmentation; here the destination recognizes a fixed token shape and cleanup changes which tokens qualify. The stateful test article uses repeated test calls on one object; today we inspect all iterator results from one operation. We do not attach annotations, parse code identifiers or assume the expression captures every digit system. The cleaner has no knowledge of this token grammar and performs no index remapping.
Recompute matches against the edited text version
If a destination stores regex matches, associate them with the exact string and pattern that produced them. After a deliberate edit, compute the result set again and compare both membership and positions. Merely subtracting one from old indices would miss the newly valid ID7 in our first row. Code-point counts also cannot substitute for UTF-16 positions, as the smile control demonstrates. These downloads reproduce the specified four strings in the recorded runtime. They do not supply a general annotation migration algorithm, establish a production identifier schema or infer that a nonmatching token contains an unwanted marker. Review the intended token before removing its character.
Reproduce this test
Save reproduce.cjs and tested-app.js in the same folder. Run the command below with Node.js. The harness prints its runtime, script SHA-256 and every measured row. Compare those rows with the original record. Using a newer script or runtime creates a new experiment; retain the version information with your rerun.
node reproduce.cjsReference and next check
ECMAScript string operations provides the relevant primary definition. The table and fixture analysis are original measurements. For broader inspection, use our Unicode inspector. Read the scope distinction before interpreting cleanup as a watermark result.