PatternCountMultiTotal ( Text ; SearchList, CaseSensitive )
It extend the PatternCount function to a valuelist
Average rating: 4.0 (6 votes) Log in to vote
Philip Wang - Show more from this author
106th Street Wheel and Tire
PatternCountMultiTotal( "We jump we laugh we smile we JUMP again.";"We¶JUMP"; 1 )
Function definition: (Copy & paste into FileMaker's Edit Custom Function window)
If the SearchList contains only one value, it acts exactly like PatternCount, except that CaseSensitive option.
The order of the value list doesn't matter. For example, if Text is "888 888", and the SearchList is "888¶8". The search of "888" always returns 2, the search of "8" always returns 6, no matter the order of the list.
I use this function to check invalid characters in a string.
|Philip Wang, 106th Street Wheel and Tire
Feb 18, 2017
|The reason I use Substitute instead of direct PatternCount is for the CaseSensitive. PatternCount don't have this option so I had to do it this way.
With this function the validating multiple invalid characters became easy. Here is and example:
Not PatternCountMultiTotal ( Self ; "|¶'¶\"¶,¶;¶ ¶/¶\\" ; 0 )
The above will validate against the characters | ' " , ; / \ and space. You can add any characters or words that you don't like.
Also a good use of it is to search multiple derogatory terms. You can have a long list of words that's not allow, run this function and you will see any hits.
Note: these functions are not guaranteed or supported by BrianDunning.com. Please contact the individual developer with any questions or problems.