Skip to content

Instantly share code, notes, and snippets.

@heffcodex
Created December 14, 2022 23:05
Show Gist options
  • Save heffcodex/bd9e0f57140321f95c471fbddb1d457b to your computer and use it in GitHub Desktop.
Save heffcodex/bd9e0f57140321f95c471fbddb1d457b to your computer and use it in GitHub Desktop.
Go URL Regex
(?is)(?P<prefix>^|[\s\p{P}\p{S}])(?P<match>(https?://)?([a-zа-я0-9_-]+\.)+(xn--)?[a-zа-я0-9]{2,}(/[a-z0-9/%@._~+-]*)?(\?[a-z0-9/%@&\[\];_=+-]*)?(#[a-z0-9/%@&\[\];_=+-]*)?)(?P<suffix>[\s\P{L}]|$)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment