Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;

import java.util.regex.MatchResult;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

public class Main {
    public static String url2Folder(String url) {
        Pattern p = Pattern.compile("android/(.*?)/");
        Matcher m = p.matcher(url);
        if (m.find()) {
            MatchResult mr = m.toMatchResult();
            return mr.group(1);
        } else {
            return null;
        }
    }
}