Escape user text so it can be inserted into a regular expression literally.
The frame below runs the same code as this page, in the reader's own browser. Nothing is sent to us, and nothing is sent to you.
Pick a dark background and the text and panels follow it, so the frame stays readable on a dark page.
Regex metacharacters receive safe escapes so their operator meaning is removed; the result can be embedded as one literal fragment. The operation protects dynamic patterns from accidental wildcards and injection.
https://example.com/path?q=1&r=2
https://example\.com/path\?q=1&r=2
Search boxes, log filters, and fixture-generated patterns escape user text.