###Function###
StringRegExp

###Description###
Check if a string fits a given regular expression pattern.

###Syntax###
StringRegExp ( "test", "pattern", [ flag ] )


###Parameters###
@@ParamTable@@
test
	The string to check
pattern
	The regular expression to compare.
flag
	[optional] A number to indicate how the function behaves.  See below for details.  The default is 0.
@@End@@
<br>
@@StandardTable@@@
Flag Values	Add the flag values together to get the desired behaviour.
0	Return true/false (1/0) as to whether the test matched the pattern.
1	Return an array with the text that matched all the group patterns.  Check @Extended as to whether the pattern matched or not.
2	Perform a global search, not a single search.
@@End@@

###ReturnValue###
Check @Error to make sure the function executed properly.
@@ReturnTable@@
@Error	Meaning
0	Executed properly.  Check @Extended and/or the return value to determine if the pattern was found or not.
1	Flag invalid.  Return value is "".
2	Pattern invalid.  Return value is the first location in the string that was invalid, as an integer.
@@End@@
<br>
@Extended is true (1) or false (0) depending if the test string matched the pattern string.  The return value is dependent on the Flag value.  If the flag is set for true/false, then the return value will match @Extended.  If the flag is set for array return then the following table applies.
@@ReturnTable@@
@Extended	Return value.
0 (false)	Match not found.  Return value is "" (empty string).
1 (true)	Match found.  Return value is an array of all group values.  If there are no groups in the pattern, the function returns "" (empty string).
@@End@@

###Remarks###
Regular expression notation is a compact way of specifying a pattern for strings, that can be searched.  Regular expressions are character strings in which plain text characters indicate what text must exist in the target string, and a some characters are given special meanings to indicate what variability is allowed in the target string. 

Regular expressions are constructed of one or more of the following simple regular expression specifiers.  If the character is not in the following table, then it will only match itself.

Regular expressions are case-sensitive.  

Repeating charactrers (*, +, ?, {...} ) will try to match the largest set possible, unless followed immediately by a question mark; then it will find the smallest pattern that allows the following characters to match as well.

Nested groups are allowed, but keep in mind that all the groups assign to the returned array, with the outer groups assigning after the inner groups.

@@StandardTable@@
<b><u>Matching Characters</u></b>	
[ ... ]	Match any character in the set.  e.g. <b>[aeiou]</b> matches any lower-case vowel.  A contiguous set can be defined using a dash between the starting and ending characters.  e.g. [a-z] matches any lower case character.  To include a dash (<b>-</b>) in a set, use it as the first or last character of the set.  To include a closing bracket in a set, use it as the first character of the set.  e.g. [][] will match either [ or ].  Note that special characters do not retain their special meanings inside a set, with the exception of \n, \t, and \\.
[^ ... ]	Match any character <b>not</b> in the set.  e.g. <b>[^0-9]</b> matches any non-digit.  To include a caret (<b>^</b>) in a set, put it after the beginning of the set.
( ... )	Group.  The elements in the group are treated in order and can be repeated together.  e.g. <b>(ab)*</b> will match "ab" or "abab", but not "abb".  A group may also be stored in the array returned by the function, depending on flag value.
<b>.</b>	Match any single character
|	Or.  The expression on one side <b>or</b> the other can be matched.
\	Escape a special character (have it match the actual character) or introduce a special character type (see below)
\\	match an actual backslash (\)
\a	Match any alphabetic character (a-z, A-Z)
\A	Match any alphanumeric character (a-z, A-Z, 0-9)
\b	Match any spaces between words.
\d	Match any digit (0-9)
\l (lower-L)	Match any lower-case letter (a-z)
\n	Match a newline or carriage return.
\p	Match any punctuation character.
\s	Match any whitespace character: Chr(9) through Chr(13) which are Horizontal Tab, Line Feed, Vertical Tab, Form Feed, and Carriage Return, and the standard space ( Chr(32) ).
\t	Match a tab character.
\u	Match any capital letter (A-Z)
\w	Match any "word" character: a-z, A-Z or underscore (_)
\x	Match any hexidecimal character.
\0###	Match the ascii character whose code is given.  Can be up to 3 digits.
\#	Position.  Record the current character location in the string into the returned content array.
\<	Match beginning of word.
\>	Match end of word.
<u><b>Repeating Characters</u></b>	
{<i>x</i>}	Repeat the previous character, set or group exactly <i>x</i> times.
{<i>x</i>,}	Repeat the previous character, set or group at least <i>x</i> times.
{,<i>x</i>}	Repeat the previous character, set or group at most <i>x</i> times.
{<i>x</i>, <i>y</i>}	Repeat the previous character, set or group between <i>x</i> and <i>y</i> times, inclusive.
*	Repeat the previous character, set or group 0 or more times.  Equivilant to {0,}
+	Repeat the previous character, set or group 1 or more times.  Equivilant to {1,}
?	The previous character, set or group may or may not appear.  Equivilang to {0, 1}
? (after a repeating character)	Find the smallest match instead of the largest.
@@END@@

###Related###
Dim, StringInStr, StringRegExpReplace

###Example###
@@IncludeExample@@
