Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;

import android.text.TextUtils;

import java.util.regex.Pattern;

public class Main {
    private final static String CONTRACT_NAME_PATTERN = "^.*(`|~|!|@|#|\\$|%|\\^|&|\\*|\\(|\\)|_|-|\\+|=|\\{|\\}|\\[|\\]|;|:|\\.|,|/|\\?|'|\\||\"|\\\\)+.*$";

    public static boolean isContractNameValid(String name) {
        if (!TextUtils.isEmpty(name)) {
            return !Pattern.matches(CONTRACT_NAME_PATTERN, name);
        }
        return true;
    }
}