Public Member Functions | |
| setNotFoundValue ($mixNotFoundedValue) | |
| getNotFoundedValue () | |
| setRegularExpressionList ($arrRegularExpressionList) | |
| getRegularExpressionList () | |
| addRegularExpression ($strRegularExpression, $mixValue=TRUE) | |
| found ($strName) | |
| isEmpty () | |
| match ($strName) | |
Protected Attributes | |
| $arrRegularExpressionList = array() | |
| $arrValueList = array() | |
| $mixNotFoundedValue = FALSE | |
Definition at line 12 of file RuleRegularExpressionMatch.class.php.
| addRegularExpression | ( | $ | strRegularExpression, | |
| $ | mixValue = TRUE | |||
| ) |
Add a class RegularExpression into the RegularExpression list
RuleMatchList::setRegularExpressionList( String[] )
RuleMatchList::getRegularExpressionList()
| string | $strRegularExpression |
Definition at line 101 of file RuleRegularExpressionMatch.class.php.
00102 { 00103 $intKeyRegularExpression = sizeof( $this->arrRegularExpressionList ); 00104 $this->arrRegularExpressionList[ $intKeyRegularExpression ] = $strRegularExpression; 00105 $this->arrValueList[ $intKeyRegularExpression ] = $mixValue; 00106 return $this; 00107 }
| found | ( | $ | strName | ) |
Search the element into the array and returns true if founded and false if not
| string | $strName |
Definition at line 116 of file RuleRegularExpressionMatch.class.php.
00117 { 00118 foreach( $this->arrRegularExpressionList as $intRegularExpressionKey => $strRegularExpression ) 00119 { 00120 if( ereg( $strRegularExpression , $strName ) ) 00121 { 00122 return TRUE; 00123 } 00124 } 00125 00126 return FALSE; 00127 }
| getNotFoundedValue | ( | ) |
Get the not founded value
RuleRegularExpressionMatch::setNotFoundValue( mixer )
Definition at line 61 of file RuleRegularExpressionMatch.class.php.
Referenced by match().
| getRegularExpressionList | ( | ) |
get the array with the RegularExpression list into the match
RuleMatchList::setRegularExpressionList( String[] )
Definition at line 87 of file RuleRegularExpressionMatch.class.php.
| isEmpty | ( | ) |
Returns if the rule is empty
Definition at line 134 of file RuleRegularExpressionMatch.class.php.
| match | ( | $ | strName | ) |
Match the string RegularExpression
| string | $strRegularExpression |
Definition at line 146 of file RuleRegularExpressionMatch.class.php.
References getNotFoundedValue().
00147 { 00148 $intKeyFound = FALSE; 00149 foreach( $this->arrRegularExpressionList as $intRegularExpressionKey => $strRegularExpression ) 00150 { 00151 if( ereg( $strRegularExpression , $strName ) ) 00152 { 00153 $intKeyFound = $intRegularExpressionKey; 00154 } 00155 } 00156 00157 if( $intKeyFound !== FALSE ) 00158 { 00159 $mixReturn = $this->arrValueList[ $intKeyFound ]; 00160 } 00161 else 00162 { 00163 $mixReturn = $this->getNotFoundedValue(); 00164 } 00165 return $mixReturn; 00166 }
| setNotFoundValue | ( | $ | mixNotFoundedValue | ) |
Set the not founded value
RuleRegularExpressionMatch::getNotFoundValue()
| mixer | $mixNotFoundedValue |
Definition at line 48 of file RuleRegularExpressionMatch.class.php.
References $mixNotFoundedValue.
00049 { 00050 $this->mixNotFoundedValue = $mixNotFoundedValue; 00051 return $this; 00052 }
| setRegularExpressionList | ( | $ | arrRegularExpressionList | ) |
Set the array with the RegularExpression list into the match
RuleMatchList::getRegularExpressionList()
| String[] | $arrRegularExpressionList |
Definition at line 74 of file RuleRegularExpressionMatch.class.php.
References $arrRegularExpressionList.
00075 { 00076 $this->arrRegularExpressionList = $arrRegularExpressionList; 00077 return $this; 00078 }
$arrRegularExpressionList = array() [protected] |
Array with the string RegularExpression list what should be match
If is empty, anyone can enter.
string[]
Definition at line 22 of file RuleRegularExpressionMatch.class.php.
Referenced by setRegularExpressionList().
$arrValueList = array() [protected] |
array with the values of the match if founded
array
Definition at line 29 of file RuleRegularExpressionMatch.class.php.
$mixNotFoundedValue = FALSE [protected] |
value of the match when the element not be found into the RegularExpression list
Definition at line 38 of file RuleRegularExpressionMatch.class.php.
Referenced by setNotFoundValue().
1.5.9