CLAUDE WATERMARK REMOVER · PRACTICAL TEST
How do I keep cleaned search text literal in a RegExp?
In our Node test, RegExp.escape preserves literal punctuation when constructing a pattern. Raw cleaned a.b matches axb; its escaped version does not. Escaping also makes our unmatched bracket usable as literal text.
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 wildcard direct string / keep / invisible true | "a.b"U+0061 U+200B U+002E U+0062 | "a.b"Removed 1 invisible character | {"raw":{"accepted":true,"matchesAxB":false,"matchesLiteral":true},"escaped":"\\x61\\.b","matchesAxB":false,"matchesLiteral":true}{"raw":{"accepted":true,"matchesAxB":true,"matchesLiteral":true},"escaped":"\\x61\\.b","matchesAxB":false,"matchesLiteral":true} |
| Plain wildcard direct string / keep / invisible true | "a.b"U+0061 U+002E U+0062 | "a.b"No selected invisible characters found | {"raw":{"accepted":true,"matchesAxB":true,"matchesLiteral":true},"escaped":"\\x61\\.b","matchesAxB":false,"matchesLiteral":true}{"raw":{"accepted":true,"matchesAxB":true,"matchesLiteral":true},"escaped":"\\x61\\.b","matchesAxB":false,"matchesLiteral":true} |
| Visible bracket direct string / keep / invisible true | "a[b"U+0061 U+005B U+0062 | "a[b"No selected invisible characters found | {"raw":{"accepted":false,"errorName":"SyntaxError"},"escaped":"\\x61\\[b","matchesAxB":false,"matchesLiteral":true}{"raw":{"accepted":false,"errorName":"SyntaxError"},"escaped":"\\x61\\[b","matchesAxB":false,"matchesLiteral":true} |
| Plain letters direct string / keep / invisible true | "ab"U+0061 U+0062 | "ab"No selected invisible characters found | {"raw":{"accepted":true,"matchesAxB":false,"matchesLiteral":true},"escaped":"\\x61b","matchesAxB":false,"matchesLiteral":true}{"raw":{"accepted":true,"matchesAxB":false,"matchesLiteral":true},"escaped":"\\x61b","matchesAxB":false,"matchesLiteral":true} |
Cleaning and escaping perform different jobs
The first search spelling contains U+200B before a visible dot. Its raw anchored pattern does not match axb before deletion but does after deletion. The escaped construction does not match axb at either stage and does match its own literal input. The plain a.b reference shows that wildcard behavior exists even without a marker. Raw a[b throws SyntaxError, while escaping permits a literal match of that spelling. The ab reference supplies a simple letter control. We record the escaped source itself, including the leading hexadecimal escape emitted for a, instead of assuming that escaping only inserts a backslash before punctuation.
The flags and match targets stay fixed
Every successful pattern uses a noncapturing group, start and end anchors and the u flag. The cross-check target is always axb, and the literal target is exactly the string being observed at that stage. The earlier regex page asks how cleanup changes an authored pattern; this question introduces the separate RegExp.escape API for text intended as data. We do not measure an editor search box, replacement template, regex performance or a runtime lacking this API. The recorded Node version supports the method; a reproduction should retain that version information instead of silently substituting a handmade escaping function with a different contract.
Decide whether users supply syntax or literal text
Preserve the original input and define whether the destination expects a regular expression or a literal search term. For the literal case, apply the documented escaping mechanism at construction and verify representative matches and nonmatches. If regex syntax is intentional, escaping would change that intention and needs a separate decision. Our fixture matrix demonstrates wildcard activation and an unchanged bracket error that selected-character deletion cannot solve. It does not establish that all patterns are safe, that a search engine follows JavaScript semantics or that escaping certifies a watermark result. Exact source snapshots and downloads make the limited construction experiment independently repeatable.
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 RegExp.escape 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.