Skip to content

Instantly share code, notes, and snippets.

@RokkuCode
Last active November 24, 2022 13:39
Show Gist options
  • Save RokkuCode/cb96c36cd34a7669bfa93def1f8f5453 to your computer and use it in GitHub Desktop.
Save RokkuCode/cb96c36cd34a7669bfa93def1f8f5453 to your computer and use it in GitHub Desktop.

Revisions

  1. pyloor revised this gist Nov 24, 2016. No changes.
  2. pyloor renamed this gist Nov 24, 2016. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  3. pyloor revised this gist Nov 24, 2016. No changes.
  4. pyloor revised this gist Nov 24, 2016. No changes.
  5. pyloor created this gist Nov 24, 2016.
    19 changes: 19 additions & 0 deletions gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,19 @@
    \b((?=[a-z0-9-]{1,63}\.)(xn(-{0,4}))?[a-z0-9]+(-[a-z0-9]+)*\.)+((xn(-{0,4}))?[a-z0-9]+)

    Testcases:
    xn--dmin-moa0i.example
    xn--aaa-pla.example
    xn--aaa-qla.example
    xn--aaa-rla.example
    xn--aaa-sla.example
    xn--dj-kia8a.vu.example
    xn--efran-2sa.example
    xn--and-6ma2c.example
    xn--bcdf-9na9b.example
    xn----ymcbaaajlc6dj7bxne2c.xn--wgbh1c
    xn--n3h.example
    xn--fuball-cta.example
    heise.de
    n0c.de
    wel-1.de
    44444444.de