package com.validation;

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

public class Validation {

    /**
     * Determines if a given input is numeric or not
     * @param test A String that is being matched.
     * @return A boolean value equating to True if the String is numerical/decimal.
     */
    public static Boolean IsNumeric(String test) {
        final String REGEX = "[0-9]*\\.?[0-9]*";
        Pattern p = Pattern.compile(REGEX);
        Matcher m = p.matcher(test);
        boolean result = m.matches();
        return result;
    }

}
