Recommend this page to a friend! |
Classes of Thomas Björk | udPattern | README.md | Download |
|
DownloadudPatternQuick documentation TestPattern($check, $easyTest, $delimiter)Test a pattern against the registered patterns in the object. returnsreturns a positive number for any accepted match returns a negative number for any rejected match returns 0 for any any test that doesn't match anything unless $easyTestis set to false, then it returns false for any unmatched test $checkthe pattern to test $easyTestif set to false the test will return false if no matching found $delimiterthe delimiter used CleanPattern($pattern, $delimiter)Clean up a pattern. Removes redundant information and reorders the pattern. returnsa clean pattern $patternthe pattern to clean $delimiterthe delimiter used CheckPattern($pattern1, $pattern2, $delimiter)Check is $pattern2 can be matched against $pattern1. Any wildcard in $pattern2 will be ignored. returnstrue if match false if not $delimiterthe delimiter used SetPatternArray($array)Set a pre-defined array of patterns. $arraya one-dimension array with patterns $delimiterthe delimiter used SetPatternString($pattern, $delimiter)Set a string of patterns $patterna string of patterns $delimiterthe delimiter used to separate patterns ClearPatterns()Clear the internal pattern array Add($pattern, $delimiter)Add a pattern to the internal array. All patterns that are added will be cleaned and tested for redundancy. $patternthe pattern to add $delimiterthe delimiter used Validation orderThe validation of a pattern is made in the added order. First added is first checked. If you use the Add function then the added pattern vill be tested against previously added patterns. If the new pattern is redundant then it will not be added. Patterns
Cleaning
Note! In the sections Patterns and Cleaning the default $delimiter (.) is used. |