find Url using predefined pattern from android.util.Patterns - Android android.util

Android examples for android.util:Patterns

Description

find Url using predefined pattern from android.util.Patterns

Demo Code

import java.util.regex.Matcher;

import android.util.Patterns;

public class Main{

    public static String findUrl(String text) {
        String url;//  w  w w.  j  av a 2 s. c om
        Matcher matcher = Patterns.WEB_URL.matcher(text);
        url = matcher.group(0);
        return url;
    }

}

Related Tutorials