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 http://www.106sttire.com |
PatternCountMultiTotal( "We jump we laugh we smile we JUMP again.";"We¶JUMP"; 1 )
2
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.
Comments
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. |
||
Tjebbe van Tijen, IMP Oct 6, 2024 |
||
" and you will see any hits" and you will not see any hits a small lapsus... I am grateful for this Custom function which I started to use for robot-classification of complicated mostly bibliographical text blocks... I have chosen to first substitute specific strings with interpunction in this way: pp.=ppx p.=px uitg.=uitgx Uitg.=uitgx bron:bronx Bron:bronx http:=httpx https:=httpsx etc. It helps me in a project with what I would call non-consistent semi-structured data produced over decades that needs to be converted to what we call "a knowledge system" |
||
Note: these functions are not guaranteed or supported by BrianDunning.com. Please contact the individual developer with any questions or problems.