How to check entered value is digit or mail

In most programming languages, you can use regular expressions (regex) to check if an input value is a digit or an email address. Here are some examples:

Checking if a value is a digit:

public boolean isDigit(String value) { Pattern pattern = Pattern.compile("^[0-9]+$"); Matcher matcher = pattern.matcher(value); return matcher.matches(); }

**Checking if a value is an email address:**

* In JavaScript:
```javascript
function isEmail(value) {
  return /^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/.test(value);
}

public boolean isEmail(String value) { Pattern pattern = Pattern.compile("^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$"); Matcher matcher = pattern.matcher(value); return matcher.matches(); }


Note that these are just examples, and you may need to adjust the regex patterns to fit your specific requirements.

Also, keep in mind that these checks are not foolproof, and it's always a good idea to validate user input thoroughly to prevent potential security vulnerabilities.