Template:is url

From diffies' wiki
Revision as of 06:17, 19 October 2026 by Diffie (talk | contribs) (Created page with "<onlyinclude><includeonly>{{#if: {{{preview|}}} | Is <code>{{{1}}}</code> an URL (and not an article name)?  | }}{{#if: {{#explode:{{{1}}}|//|1|2}} | {{{doubly slashed|{{{yes|yes}}}}}} | {{#ifeq: {{#sub:{{{1}}}|0|1}} | / | {{{slash prefixed|{{{yes|yes}}}}}} | {{{no|no}}} }} }}</includeonly></onlyinclude> == Demo == *{{is url|preview=yes |https://diffie.eu}} *{{is url|preview=yes |ftp://ftp.diffie.eu}} *{{is url|preview=yes |//ftp.diffie.eu}} *{{is ur...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search


Demo

  • Is https://diffie.eu an URL (and not an article name)? yes
  • Is ftp://ftp.diffie.eu an URL (and not an article name)? yes
  • Is //ftp.diffie.eu an URL (and not an article name)? yes
  • Is /wiki/foo/bar an URL (and not an article name)? yes
  • Is Main_Page an URL (and not an article name)? no
  • Is Main Page an URL (and not an article name)? no

Parameters

preview=1 (a non-empty string)

Produce demos like these above.

yes and no

What to return if it is/isn't an URL.

doubly slashed and slash prefixed

More specialized forms of yes=