yn-smooks-all.1.4.1.source-code.smooks-regex.properties Maven / Gradle / Ivy
#----------------------------------------------------------#
# Default regular expression that will be loaded by Smooks #
#----------------------------------------------------------#
# Email
email=\\w+([-+.]\\w+)*@\\w+([-.]\\w+)*\\.\\w+([-.]\\w+)*([,;]\\s*\\w+([-+.]\\w+)*@\\w+([-.]\\w+)*\\.\\w+([-.]\\w+)*)*
# Phone Numbers
# Australia
phoneNumberAU=(^1300\\d{6}$)|(^1800|1900|1902\\d{6}$)|(^0[2|3|7|8]{1}[0-9]{8}$)|(^13\\d{4}$)|(^04\\d{2,3}\\d{6}$)
# United Kingdom
phoneNumberGB=^(((\\+44\\s?\\d{4}|\\(?0\\d{4}\\)?)\\s?\\d{3}\\s?\\d{3})|((\\+44\\s?\\d{3}|\\(?0\\d{3}\\)?)\\s?\\d{3}\\s?\\d{4})|((\\+44\\s?\\d{2}|\\(?0\\d{2}\\)?)\\s?\\d{4}\\s?\\d{4}))(\\s?\\\#(\\d{4}|\\d{3}))?$
# India
phoneNumberIN=^0{0,1}[1-9]{1}[0-9]{2}[\\s]{0,1}[\\-]{0,1}[\\s]{0,1}[1-9]{1}[0-9]{6}$
# Italy
phoneNumberIT=^([0-9]*\\-?\\ ?\\/?[0-9]*)$
# Netherlands
phoneNumberNL=([0]{1}[6]{1}[-\\s]*[1-9]{1}[\\s]*([0-9]{1}[\\s]*){7})|([0]{1}[1-9]{1}[0-9]{1}[0-9]{1}[-\\s]*[1-9]{1}[\\s]*([0-9]{1}[\\s]*){5})|([0]{1}[1-9]{1}[0-9]{1}[-\\s]*[1-9]{1}[\\s]*([0-9]{1}[\\s]*){6})
# Sweden
phoneNumberSE=\\d{2,4}-\\d{6,10}
# United States
phoneNumberUS=^(1\\s*[-\\/\\.]?)?(\\((\\d{3})\\)|(\\d{3}))\\s*[-\\/\\.]?\\s*(\\d{3})\\s*[-\\/\\.]?\\s*(\\d{4})\\s*(([xX]|[eE][xX][tT])\\.?\\s*(\\d+))*$
# Dates
dateMMddyyyy=^(([0]?[1-9]|1[0-2])/([0-2]?[0-9]|3[0-1])/[1-2]\\d{3})? ?((([0-1]?\\d)|(2[0-3]))\:[0-5]\\d)?(\:[0-5]\\d)? ?(AM|am|PM|pm)?$
dateyyyyMMdd=^((((19|20)(([02468][048])|([13579][26]))-02-29))|((20[0-9][0-9])|(19[0-9][0-9]))-((((0[1-9])|(1[0-2]))-((0[1-9])|(1\\d)|(2[0-8])))|((((0[13578])|(1[02]))-31)|(((0[1,3-9])|(1[0-2]))-(29|30)))))$
# Time
# TODO: naming strategy for different time regexes. Should be easy to read and identify the time format.
time=^((0?[1-9]|1[012])(\:[0-5]\\d){0,2}(\\ [AP]M))$|^([01]\\d|2[0-3])(\:[0-5]\\d){0,2}$
# TODO: Add more regular expressions.
# Found a few useful ones at http://regexlib.com/