Skip to content

Default search should be literal; regex should be opt‑in? #74

@oekeur

Description

@oekeur

Hi!

We’re seeing editors report this as a bug:
When they try to replace a specific character sequence, other text gets replaced too. Example from our newsroom: searching for .’ and replacing with ." also replaces letters before the quote, because . is treated as “any character.” From their perspective, they typed a literal string and the plugin “over‑replaced.”

Right now, the input is interpreted as a regex by default, which is surprising for non‑technical users. They expect plain text matching.

Proposed fix:

  • Make literal matching the default (escape regex characters).
  • Add a clear “Use Regular Expression” toggle for users.
  • Persist that toggle per user via core/preferences.
  • If the regex is invalid, show a friendly error.

This keeps advanced regex support, but avoids the current “unexpected replacements” that feel like a bug for editors.

I have a PR lined up if you are OK with this :)

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingchoreAn assigned task to be donetestAdd unit tests

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions