package com.zjty.inspect.utils;

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

/**
 * @author Mcj
 * @date 2020-03-04 23:39
 */

public class RegexUtil {
    private static Pattern pattern = Pattern.compile("-[0-9]");
    public static String patten(String string){
        Matcher matcher = pattern.matcher(string);
        if (matcher.find()) {
            int i = string.indexOf(matcher.group());
            String substring = string.substring(0, i);
            return substring;
        }
        return "";
    }
}
