//The regular expression starts and ends with a forward slash;
//. matches any singular character.
//  ? matches one or none of the preceding character.
//  + matches at least one of the preceding character.
//  * matches none or all of the preceding character.
//  ^ matches the absolute beginning of the string.
//  $ matches the absolute end of the string.
// \w+ matches a whole word.
//  \w matches a "word" character (alphanumerics and the "_" character).
//  \W+ matches whitespace.
//  x|y matches one or the other of x or y.
// [0..9] matches ONE number, ranging from 0 to 9.
// [A-Za-z] matches any letter, uppercase or lowercase.

// checks if any data exists other than blanks in the first characater
// REQUIRED FIELD CHECK
data_exists_pattern =  /^[^ ]/;

//e-mail
email_pattern = /^(\w|\.|\-)+@(\w|\.|\-)+\.(((com|net|org|edu|gov|mil|biz|[a-z]{2}) *$)|(((com|net|org|edu|gov|mil)\.[a-z]{2}) *$))/i;

//floating point number  /^((\d+(\.\d*)?)|((\d*\.)?\d+))$/  1.2 or .9 or 8.
float_pattern = /^((\d+(\.\d*)?)|((\d*\.)?\d+))$/

//United/Mayflower type logon
agent_pattern = /(u|m)+\d{4}/i;

// alphabetic string  aAbB, * at end makes it accept trailing blanks
alpha_pattern = /^[a-zA-Z]+ *$/; 

// alphanumeric string a1b2, * at end makes it accept trailing blanks
alphnum_pattern =  /^[a-zA-Z0-9]+ *$/;

// alphanumeric string a1b2, * at end makes it accept trailing blanks
nonblank_pattern =  /^[a-zA-Z0-9.]+ *$/;

// alphanumeric string anything numeric, alphabetic and _ 
valid_xmltag = /^([a-zA-Z0-9]|\_)+ *$/;

// alphanumeric string a1b2, MUST BE VALID PASSWORD
//valid_password = /^(\w){4}/;
valid_password = /^\S\S\S\S/;	// at least 4 nonwhite spaces

// alphanumeric string a1b2, MUST HAVE A LENGTH OF 4
alphnum_four_long = /^(\w){4}/;

// alphanumeric with symbols string a1b2 or . or -
alphnumsymb_four_long = /^(\w|\.|\-){4,15} *$/;

// valid_state
valid_state= /^(AL|AK|AZ|AR|CA|CO|CT|DE|DC|FL|GA|HI|ID|IL|IN|IA|KS|KY|LA|ME|MD|MA|MI|MN|MS|MO|MT|NE|NV|NH|NJ|NM|NY|NC|ND|OH|OK|OR|PA|RI|SC|SD|TN|TX|UT|VT|VA|WA|WV|WI|WY)/i;

//6 digit zip code
zip_pattern = /^\d{5}/;

//integer    0 or 123 
num_pattern = /^\d+$/;

// matches anything that is not 0-9
non_numeric = /^\D+$/;

// phone_pattern
// phone_pattern = /^ *\\(? *([0-9][0-9][0-9]) *\\)? *([0-9][0-9][0-9]) *-? *([0-9][0-9][0-9][0-9]) *$/;
// this is how phone can be displayed on a page	 = "(" + RegExp.$1 + ") " + RegExp.$2 + "-" + RegExp.$3;

// phone_pattern
phone_pattern = /^\d{10}/;

//ssn

ssn_pattern = /^ *([0-9][0-9][0-9]) *-? *([0-9][0-9]) *-? *([0-9][0-9][0-9][0-9]) *$/;

// time like "1:03" or "10:36" but not military time like "21:12"

time_pattern = /^(([1][012])|([0]?[1-9]))[:][0-5]\d$/;

// url 
//^(([^:]+)://)?([^:/]+)(:([0-9]+))?(/.*)
//(^.+)(\?|\#)(.$)
//([a-z]*://)?[^@.:/]*([:/.][^:/.]*)+
//url_pattern = /^[a-zA-Z0-9]{3,}[\/.:]{1}+\S+((com|net|org|edu|gov|mil|htm|jsp|html|asp|[a-zA-Z0-9]{3,}) *$)/i;



//whitespace  /^\s+$/  spaces or tabs etc. 

//single letter  /^[a-zA-Z]$/  a thru z or A thru Z 
 
//single digit  /^\d/  0 thru 9 


//single letter or digit  /^([a-zA-Z]|\d)$/  0 thru 9 or a thru z or A thru Z 


//signed integer  /^(+|-)?\d+$/  -1 or +123
 
//floating point number  /^((\d+(\.\d*)?)|((\d*\.)?\d+))$/  1.2 or .9 or 8. 

//signed float  /^(((+|-)?\d+(\.\d*)?)|((+|-)?(\d*\.)?\d+))$/  -1.1 or 1.1 or .9 or 8. 