Skip to content
Perl 6 Module to find all URL's in a text
Other
  1. Other 100.0%
Branch: master
Clone or download

Latest commit

Fetching latest commit…
Cannot retrieve the latest commit at this time.

Files

Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
example
lib/URL
t
.gitignore
.travis.yml
META6.json
README.md

README.md

Build Status

TITLE

URL::Find

SUBTITLE

A Perl 6 module to find all the URL's in a set of text.

DESCRIPTION

By default it will match domain names that use unicode characters such as http://правительство.рф. To only match ASCII domains use the :ascii option. It will also find URL's that end in one of the restricted characters, so https://www.google.com, will pull out https://www.google.com. It will find all the URL's in a text by default, or you can specify a maximum number with the :limit option. By default it will only find http, https, ftp, git and ssh schemes, but you can specify :any<1> to match any schemes with legal characters..

sub find-urls

sub find-urls(
    Str $string, 
    Num :$limit is copy, 
    :$ascii, 
    :$any
) returns List

Accepts a string and returns a list of URL's. Optionally you can specify a limit to the number of URL's returned, or whether you want to only match URL's with ASCII domain names: :ascii<1> Matches only http https ftp git and ssh schemes by default. To match any scheme, use :any<1>

AUTHOR

Samantha McVey (samcv) samantham@posteo.net

LICENSE

This is free software; you can redistribute it and/or modify it under the Artistic License 2.0.

You can’t perform that action at this time.