Package RegExHelper
Class RegExHelper
java.lang.Object
RegExHelper.RegExHelper
public class RegExHelper
extends java.lang.Object
A class to assist with the use of Regular Expressions
-
Field Summary
Fields Modifier and Type Field Description static java.util.regex.PatternisAlphaa regular expression to check if a String is alphabeticalstatic java.util.regex.PatternisAlphaNumerica regular expression to check if a String is alpha numericstatic java.util.regex.PatternisAlphaNumericSpacea regular expression to check if a String is alpha numeric with spacesstatic java.util.regex.PatternisAlphaSpacea regular expression to check if a String is alphabetical with spacesstatic java.util.regex.PatternisASCIIa regular expression to check if a String is made up of ASCII charactersstatic java.util.regex.PatternisBinarya regular expression to check if a String is a binary numberstatic java.util.regex.PatternisByteBinarya regular expression to check if a String is one byte in binarystatic java.util.regex.PatternisByteHexa regular expression to check if a String is one byte in hexadecimalstatic java.util.regex.PatternisDate1a regular expression to check if a String is a date in the format "MM/DD/YY"static java.util.regex.PatternisDate2a regular expression to check if a String is a date in the format "DD/MM/YY"static java.util.regex.PatternisDate3a regular expression to check if a String is a date in the format "YY/MM/DD"static java.util.regex.PatternisDateBa regular expression to check if a String is a date in the format "MMDDYY"static java.util.regex.PatternisDateCa regular expression to check if a String is a date in the format "DDMMYY"static java.util.regex.PatternisDateDa regular expression to check if a String is a date in the format "YYMMDD"static java.util.regex.PatternisEmaila regular expression to check if a String is a valid email addressstatic java.util.regex.PatternisFirstCommaLasta regular expression to check if a String is a name in the form "First, Last"static java.util.regex.PatternisFirstSpaceLasta regular expression to check if a String is a name in the form "First Last"static java.util.regex.PatternisFloata regular expression to check if a String is a floating point numberstatic java.util.regex.PatternisHexa regular expression to check if a String is hexadecimalstatic java.util.regex.PatternisHexSpacea regular expression to check if a String is hexadecimal with spacesstatic java.util.regex.PatternisLastCommaFirsta regular expression to check if a String is a name in the form "Last, First"static java.util.regex.PatternisLastSpaceFirsta regular expression to check if a String is a name in the form "Last First"static java.util.regex.PatternisNumerica regular expression to check if a String is numericstatic java.util.regex.PatternisNumericSpacea regular expression to check if a String is numeric with spacesstatic java.util.regex.PatternisOctala regular expression to check if a String is an octal numberstatic java.util.regex.PatternisRomanNumerala regular expression to check if a String is a number written in roman numeralsstatic java.util.regex.PatternisUnixTimestampa regular expression to check if a String is a valid unix timestampstatic java.util.regex.PatternisURLa regular expression to check if a String is a valid URLstatic java.util.regex.PatternisYTBase64a regular expression to check if a String is a number written in Youtube's base 64 number system -
Method Summary
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Field Details
-
isAlphaNumeric
public static final java.util.regex.Pattern isAlphaNumerica regular expression to check if a String is alpha numeric -
isAlpha
public static final java.util.regex.Pattern isAlphaa regular expression to check if a String is alphabetical -
isNumeric
public static final java.util.regex.Pattern isNumerica regular expression to check if a String is numeric -
isHex
public static final java.util.regex.Pattern isHexa regular expression to check if a String is hexadecimal -
isFloat
public static final java.util.regex.Pattern isFloata regular expression to check if a String is a floating point number -
isAlphaNumericSpace
public static final java.util.regex.Pattern isAlphaNumericSpacea regular expression to check if a String is alpha numeric with spaces -
isAlphaSpace
public static final java.util.regex.Pattern isAlphaSpacea regular expression to check if a String is alphabetical with spaces -
isNumericSpace
public static final java.util.regex.Pattern isNumericSpacea regular expression to check if a String is numeric with spaces -
isHexSpace
public static final java.util.regex.Pattern isHexSpacea regular expression to check if a String is hexadecimal with spaces -
isASCII
public static final java.util.regex.Pattern isASCIIa regular expression to check if a String is made up of ASCII characters -
isEmail
public static final java.util.regex.Pattern isEmaila regular expression to check if a String is a valid email address -
isURL
public static final java.util.regex.Pattern isURLa regular expression to check if a String is a valid URL -
isUnixTimestamp
public static final java.util.regex.Pattern isUnixTimestampa regular expression to check if a String is a valid unix timestamp -
isBinary
public static final java.util.regex.Pattern isBinarya regular expression to check if a String is a binary number -
isOctal
public static final java.util.regex.Pattern isOctala regular expression to check if a String is an octal number -
isRomanNumeral
public static final java.util.regex.Pattern isRomanNumerala regular expression to check if a String is a number written in roman numerals -
isYTBase64
public static final java.util.regex.Pattern isYTBase64a regular expression to check if a String is a number written in Youtube's base 64 number system -
isByteBinary
public static final java.util.regex.Pattern isByteBinarya regular expression to check if a String is one byte in binary -
isByteHex
public static final java.util.regex.Pattern isByteHexa regular expression to check if a String is one byte in hexadecimal -
isFirstCommaLast
public static final java.util.regex.Pattern isFirstCommaLasta regular expression to check if a String is a name in the form "First, Last" -
isLastCommaFirst
public static final java.util.regex.Pattern isLastCommaFirsta regular expression to check if a String is a name in the form "Last, First" -
isFirstSpaceLast
public static final java.util.regex.Pattern isFirstSpaceLasta regular expression to check if a String is a name in the form "First Last" -
isLastSpaceFirst
public static final java.util.regex.Pattern isLastSpaceFirsta regular expression to check if a String is a name in the form "Last First" -
isDate1
public static final java.util.regex.Pattern isDate1a regular expression to check if a String is a date in the format "MM/DD/YY" -
isDate2
public static final java.util.regex.Pattern isDate2a regular expression to check if a String is a date in the format "DD/MM/YY" -
isDate3
public static final java.util.regex.Pattern isDate3a regular expression to check if a String is a date in the format "YY/MM/DD" -
isDateB
public static final java.util.regex.Pattern isDateBa regular expression to check if a String is a date in the format "MMDDYY" -
isDateC
public static final java.util.regex.Pattern isDateCa regular expression to check if a String is a date in the format "DDMMYY" -
isDateD
public static final java.util.regex.Pattern isDateDa regular expression to check if a String is a date in the format "YYMMDD"
-
-
Method Details
-
match
public static boolean match(java.util.regex.Pattern pat, java.lang.String str)- Parameters:
pat- java.util.regex.Pattern -- the regular expression you want to usestr- java.lang.String -- the String you want to search- Returns:
- boolean -- if "str" matches the regular expression "pat"
-
mkPat
public static java.util.regex.Pattern mkPat(java.lang.String pat)- Parameters:
pat- java.lang.String -- the String of the regular expression you want to create- Returns:
- java.util.regex.Pattern -- the regular expression
-