Skip to content

Conversation

@NecRaul
Copy link

@NecRaul NecRaul commented Dec 7, 2025

This PR introduces a new optional regex field for search bangs, enabling advanced parsing of the user’s query. This allows bangs to extract multiple components from a query and substitute them into the final URL.

What this changes

  • Adds regex: string to the bang configuration schema.
  • Optional; preserves existing behavior if omitted.
  • When provided, the regex is applied to the query after removing the bang shortcut.
  • Updates:
    • Documentation (configuration.md)
    • HTML template (search.html)
    • Client-side behavior (page.js)
    • Bang struct (widget-search.go)

Why

This resolves issue #898, allowing certain shortcuts to extract multiple values from a query using a regular expression. This is especially useful for URLs that require structured query parameters, such as language codes or specific identifiers.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant