Skip to content

[Bug]: URL Regex is broken (2 character fix) #1254

@pwall2222

Description

@pwall2222

Checklist

  • I am using an up-to-date version.
  • I have read the documentation.
  • I have searched existing issues.

TagStudio Version

Alpha 9.5.6

Operating System & Version

NixOS 25.05

Description

The regex for URLs missbehaves, and causes - (dashes) in the path segment of the url to not be recognised.

This is because it takes #-* to be a range instead of a collection of [#, -, *] to fix this we only have to add a \ to put it like so #\-*

r"(http|ftp|https):\/\/([\w_-]+(?:(?:\.[\w_-]+)+))([\w.,@?^=%&:\/~+#-*]*[\w@?^=%&\/~+#-*])"

(http|ftp|https):\/\/([\w_-]+(?:(?:\.[\w_-]+)+))([\w.,@?^=%&:\/~+#\-*]*[\w@?^=%&\/~+#\-*])

Expected Behavior

For the URLs containing - in the path part to be recognised and clickable as a whole.

Steps to Reproduce

  1. Add URL Field
  2. Add URL with - in the path part for example https://docs.tagstud.io/preview-support/
  3. Only https://docs.tagstud.io/preview get's highlighted

Logs

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    TagStudio: LibraryRelating to the TagStudio library systemType: BugSomething isn't working as intendedType: UI/UXUser interface and/or user experience

    Type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions