Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;
//License from project: Open Source License 

import java.util.regex.Matcher;
import java.util.regex.Pattern;
import android.text.TextUtils;

public class Main {
    private static Pattern mauritianProcessedMobilePhoneNumber = Pattern.compile(
            "(\\+230|\\+230[ ]{1,3}|\\(\\+230\\)|\\(\\+230\\)[ ]{1,3})?5[0-9]{3}( |-)?[0-9]{2}( |-)?[0-9]{2}");

    public static final boolean isProcessedMobilePhoneNumber(CharSequence target) {

        if (target != null || TextUtils.isEmpty(target) == false) {
            Matcher numberMatcher = mauritianProcessedMobilePhoneNumber.matcher(target);
            return numberMatcher.matches();
        }

        return false;
    }
}