File extension is in extensions list: Difference between revisions
Content added Content deleted
(+Java, probably complex) |
(→{{header|Perl 6}}: extensions aren't always alphanumeric) |
||
Line 86: | Line 86: | ||
for < foo.C foo.zkl foo foo. > { |
for < foo.C foo.zkl foo foo. > { |
||
when / :i @ext $ / { say "$_\t$/ is in the list" } |
when / :i @ext $ / { say "$_\t$/ is in the list" } |
||
when / '.' |
when / '.' <-[.]>* $ / { say "$_\t$/ is not in the list" } |
||
default { say "$_\t (has no extension)" } |
default { say "$_\t (has no extension)" } |
||
}</lang> |
}</lang> |
||
{{out}} |
{{out}} |