Wednesday, 8 February 2017

Regex : LookingAt




public class LookingAtMethod {

    public static void main(String[] args) {

        String text    =
                "This is the text to be searched " +
                        "for occurrences of the http:// pattern.";
        String patternString = ".*http://.*";
        Pattern pattern = Pattern.compile(patternString);
        Matcher matcher = pattern.matcher(text);
        System.out.println(matcher);
    }

}

No comments:

Post a Comment