CLAUDE WATERMARK REMOVER · PRACTICAL TEST
Why does a cleaned regex flag string still raise SyntaxError?
Cleanup repairs our marked g flag, but gg and uv still raise SyntaxError. Duplicate flags and mutually exclusive Unicode modes are configuration problems. A cleaned pattern body does not establish that a separately supplied flag string is valid.
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 flag direct string / keep / invisible true | "g"U+0067 U+200B | "g"Removed 1 invisible character | {"error":"SyntaxError"}{"flags":"g","matched":true} |
| Global flag direct string / keep / invisible true | "g"U+0067 | "g"No selected invisible characters found | {"flags":"g","matched":true}{"flags":"g","matched":true} |
| Duplicate flag direct string / keep / invisible true | "gg"U+0067 U+0067 | "gg"No selected invisible characters found | {"error":"SyntaxError"}{"error":"SyntaxError"} |
| Conflicting Unicode flags direct string / keep / invisible true | "uv"U+0075 U+0076 | "uv"No selected invisible characters found | {"error":"SyntaxError"}{"error":"SyntaxError"} |
The tested string is configuration rather than the pattern
Every observer compiles the same fixed AB pattern body and uses the supplied text only as its flags argument. The marked g initially raises SyntaxError, then compiles with flags g and matches AB after deletion. This isolates the repaired configuration character from changes to pattern text. A fresh regular expression is constructed for each call, so a global cursor left by a previous test cannot explain either the failure or success. The cleaned output and compiled flags are both saved, making the location of the change directly inspectable.
Valid letters can still make an invalid combination
Plain g supplies a successful reference with no deletion. The duplicate gg control fails before and after, and the uv control likewise fails throughout. Neither contains one of the characters selected for removal. Those results show why counting removed invisible characters cannot serve as a compilation check. The two rejected controls exercise different configuration issues even though the exception class is the same. We intentionally record only that stable exception name rather than presenting an engine-specific message as a universal wording. No pattern supplied by a user is executed.
Compile the intended body and flags together
Retain the original configuration and surface a compile error separately from a character-cleanup status. Avoid silently deleting repeated letters or choosing one Unicode mode unless the application has an explicit policy to do so. This four-control matrix does not test every supported flag, custom regex subclasses, another engine or matching performance. The existing pattern guide studies meaning inside the pattern body; here that body never varies. The homepage neither validates nor compiles flags. These locally constructed settings are not Claude samples and do not establish that any watermark or AI-writing signal was removed.
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 RegExpInitialize 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.