pub fn autolink(text: &str) -> Vec<String> {
    if text.is_empty() {
        return vec![];
    }

    let re = Regex::new(r"(?ix)
        (?: ((?:ed2k|ftp|http|https|irc|mailto|news|gopher|nntp|telnet|webcal|xmpp|callto|feed|svn|urn|aim|rsync|tag|ssh|sftp|rtsp|afs|file):)// | www\. )
        [^\s<\x{00A0}\x{0022}]+
    ").unwrap();

    re.captures_iter(text)
        .map(|captures| captures[0].to_string())
        .collect()
}
/// Finds everything what looks like an URL inside a string. Inspired by 
/// [https://github.com/tenderlove/rails_autolink/blob/master/lib/rails_autolink/helpers.rb](https://github.com/tenderlove/rails_autolink/blob/master/lib/rails_autolink/helpers.rb)
Finds everything what looks like an URL inside a string.
Finds everything what looks like an URL inside a string .
pub fn autolink(text: &str) -> Vec<String> {
    if text.is_empty() {
        return vec![];
    }
    let re = Regex::new(r"(?ix)
        (?: ((?:ed2k|ftp|http|https|irc|mailto|news|gopher|nntp|telnet|webcal|xmpp|callto|feed|svn|urn|aim|rsync|tag|ssh|sftp|rtsp|afs|file):)// | www\. )
        [^\s<\x{00A0}\x{0022}]+
    ").unwrap();
    re.captures_iter(text)
        .map(|captures| captures[0].to_string())
        .collect()
}
pub fn autolink ( text : & str ) -> Vec < String > { if text . is_empty ( ) { return vec ! [ ] ; } let re = Regex :: new ( r"(?ix)
        (?: ((?:ed2k|ftp|http|https|irc|mailto|news|gopher|nntp|telnet|webcal|xmpp|callto|feed|svn|urn|aim|rsync|tag|ssh|sftp|rtsp|afs|file):)// | www\. )
        [^\s<\x{00A0}\x{0022}]+
    " ) . unwrap ( ) ; re . captures_iter ( text ) . map ( | captures | captures [ 0 ] . to_string ( ) ) . collect ( ) }
Finds everything what looks like an URL inside a string.
Finds everything what looks like an URL inside a string .
text
&str
text
&str