Skip to content
Snippets Groups Projects

Update hashtag regex

Closed feld requested to merge feld/auto_linker:fix/hashtags into master
1 file
+ 1
1
Compare changes
  • Side-by-side
  • Inline
+ 1
1
@@ -45,7 +45,7 @@ defmodule AutoLinker.Parser do
# https://www.w3.org/TR/html5/forms.html#valid-e-mail-address
@match_email ~r/^[a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/u
@match_hashtag ~r/^(?<tag>\#\w+)/u
@match_hashtag ~r/^(?<tag>\#[a-zA-Z][a-zA-Z0-9_]+)/u
@prefix_extra [
"magnet:?",
Loading