Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;

import java.util.regex.Matcher;
import java.util.regex.Pattern;
import android.annotation.SuppressLint;

public class Main {
    /**
     * Regex matcher for PART X pattern in multi-part videos
     * http://txt2re.com/index-java.php3
     * 
     * @param token
     * @return
     */
    @SuppressLint("DefaultLocale")
    private static boolean isMultiPartSeries(String token) {
        String re1 = "(PART)"; // Word 1
        String re2 = "( )"; // White Space 1
        String re3 = "(\\d+)"; // Integer Number 1

        Pattern p = Pattern.compile(re1 + re2 + re3, Pattern.CASE_INSENSITIVE | Pattern.DOTALL);
        Matcher m = p.matcher(token.toUpperCase());

        return m.find();
    }
}