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.Pattern isAlpha
    a regular expression to check if a String is alphabetical
    static java.util.regex.Pattern isAlphaNumeric
    a regular expression to check if a String is alpha numeric
    static java.util.regex.Pattern isAlphaNumericSpace
    a regular expression to check if a String is alpha numeric with spaces
    static java.util.regex.Pattern isAlphaSpace
    a regular expression to check if a String is alphabetical with spaces
    static java.util.regex.Pattern isASCII
    a regular expression to check if a String is made up of ASCII characters
    static java.util.regex.Pattern isBinary
    a regular expression to check if a String is a binary number
    static java.util.regex.Pattern isByteBinary
    a regular expression to check if a String is one byte in binary
    static java.util.regex.Pattern isByteHex
    a regular expression to check if a String is one byte in hexadecimal
    static java.util.regex.Pattern isDate1
    a regular expression to check if a String is a date in the format "MM/DD/YY"
    static java.util.regex.Pattern isDate2
    a regular expression to check if a String is a date in the format "DD/MM/YY"
    static java.util.regex.Pattern isDate3
    a regular expression to check if a String is a date in the format "YY/MM/DD"
    static java.util.regex.Pattern isDateB
    a regular expression to check if a String is a date in the format "MMDDYY"
    static java.util.regex.Pattern isDateC
    a regular expression to check if a String is a date in the format "DDMMYY"
    static java.util.regex.Pattern isDateD
    a regular expression to check if a String is a date in the format "YYMMDD"
    static java.util.regex.Pattern isEmail
    a regular expression to check if a String is a valid email address
    static java.util.regex.Pattern isFirstCommaLast
    a regular expression to check if a String is a name in the form "First, Last"
    static java.util.regex.Pattern isFirstSpaceLast
    a regular expression to check if a String is a name in the form "First Last"
    static java.util.regex.Pattern isFloat
    a regular expression to check if a String is a floating point number
    static java.util.regex.Pattern isHex
    a regular expression to check if a String is hexadecimal
    static java.util.regex.Pattern isHexSpace
    a regular expression to check if a String is hexadecimal with spaces
    static java.util.regex.Pattern isLastCommaFirst
    a regular expression to check if a String is a name in the form "Last, First"
    static java.util.regex.Pattern isLastSpaceFirst
    a regular expression to check if a String is a name in the form "Last First"
    static java.util.regex.Pattern isNumeric
    a regular expression to check if a String is numeric
    static java.util.regex.Pattern isNumericSpace
    a regular expression to check if a String is numeric with spaces
    static java.util.regex.Pattern isOctal
    a regular expression to check if a String is an octal number
    static java.util.regex.Pattern isRomanNumeral
    a regular expression to check if a String is a number written in roman numerals
    static java.util.regex.Pattern isUnixTimestamp
    a regular expression to check if a String is a valid unix timestamp
    static java.util.regex.Pattern isURL
    a regular expression to check if a String is a valid URL
    static java.util.regex.Pattern isYTBase64
    a regular expression to check if a String is a number written in Youtube's base 64 number system
  • Method Summary

    Modifier and Type Method Description
    static boolean match​(java.util.regex.Pattern pat, java.lang.String str)  
    static java.util.regex.Pattern mkPat​(java.lang.String pat)  

    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 isAlphaNumeric
      a regular expression to check if a String is alpha numeric
    • isAlpha

      public static final java.util.regex.Pattern isAlpha
      a regular expression to check if a String is alphabetical
    • isNumeric

      public static final java.util.regex.Pattern isNumeric
      a regular expression to check if a String is numeric
    • isHex

      public static final java.util.regex.Pattern isHex
      a regular expression to check if a String is hexadecimal
    • isFloat

      public static final java.util.regex.Pattern isFloat
      a regular expression to check if a String is a floating point number
    • isAlphaNumericSpace

      public static final java.util.regex.Pattern isAlphaNumericSpace
      a regular expression to check if a String is alpha numeric with spaces
    • isAlphaSpace

      public static final java.util.regex.Pattern isAlphaSpace
      a regular expression to check if a String is alphabetical with spaces
    • isNumericSpace

      public static final java.util.regex.Pattern isNumericSpace
      a regular expression to check if a String is numeric with spaces
    • isHexSpace

      public static final java.util.regex.Pattern isHexSpace
      a regular expression to check if a String is hexadecimal with spaces
    • isASCII

      public static final java.util.regex.Pattern isASCII
      a regular expression to check if a String is made up of ASCII characters
    • isEmail

      public static final java.util.regex.Pattern isEmail
      a regular expression to check if a String is a valid email address
    • isURL

      public static final java.util.regex.Pattern isURL
      a regular expression to check if a String is a valid URL
    • isUnixTimestamp

      public static final java.util.regex.Pattern isUnixTimestamp
      a regular expression to check if a String is a valid unix timestamp
    • isBinary

      public static final java.util.regex.Pattern isBinary
      a regular expression to check if a String is a binary number
    • isOctal

      public static final java.util.regex.Pattern isOctal
      a regular expression to check if a String is an octal number
    • isRomanNumeral

      public static final java.util.regex.Pattern isRomanNumeral
      a regular expression to check if a String is a number written in roman numerals
    • isYTBase64

      public static final java.util.regex.Pattern isYTBase64
      a 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 isByteBinary
      a regular expression to check if a String is one byte in binary
    • isByteHex

      public static final java.util.regex.Pattern isByteHex
      a regular expression to check if a String is one byte in hexadecimal
    • isFirstCommaLast

      public static final java.util.regex.Pattern isFirstCommaLast
      a regular expression to check if a String is a name in the form "First, Last"
    • isLastCommaFirst

      public static final java.util.regex.Pattern isLastCommaFirst
      a regular expression to check if a String is a name in the form "Last, First"
    • isFirstSpaceLast

      public static final java.util.regex.Pattern isFirstSpaceLast
      a regular expression to check if a String is a name in the form "First Last"
    • isLastSpaceFirst

      public static final java.util.regex.Pattern isLastSpaceFirst
      a regular expression to check if a String is a name in the form "Last First"
    • isDate1

      public static final java.util.regex.Pattern isDate1
      a regular expression to check if a String is a date in the format "MM/DD/YY"
    • isDate2

      public static final java.util.regex.Pattern isDate2
      a regular expression to check if a String is a date in the format "DD/MM/YY"
    • isDate3

      public static final java.util.regex.Pattern isDate3
      a regular expression to check if a String is a date in the format "YY/MM/DD"
    • isDateB

      public static final java.util.regex.Pattern isDateB
      a regular expression to check if a String is a date in the format "MMDDYY"
    • isDateC

      public static final java.util.regex.Pattern isDateC
      a regular expression to check if a String is a date in the format "DDMMYY"
    • isDateD

      public static final java.util.regex.Pattern isDateD
      a 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 use
      str - 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