Brian Dunning's FileMaker Custom Functions

antiFilter ( textToFilter ; filterAllow ; filterSubChar ; start ; stop ; textBuilt )

replace any character not specified in the allowed list with the substitute character

  Average rating: 4.4 (35 votes) Log in to vote

Michael Rauch   Michael Rauch

Share on Facebook Share on Twitter

  Sample input:
  Sample output:
code 999 999 9999

  Function definition: (Copy & paste into FileMaker's Edit Custom Function window)

The impetus for the custom function was to have a way to override FileMaker's built in word separators when using LeftWords (and other word evaluation functions). This tail recursive function will build a new string, substituting any non-allowed characters with the substitute character.

A call would look something like this...

textToFilter = TO::someField;
filterAllow = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"
cf_AntiFilter (textToFilter ; filterAllow ; " " ; 1 ; Length (textToFilter) ; "")



pixi   pixi, berlin
May 5, 2012
wouldn't it be shorter to have it:


Case ( start < ( Length ( textToFilter ) + 1 );
charToSub = Middle ( textToFilter; start; 1);
textBuilt = Case ( IsEmpty ( Filter ( charToSub; filterAllow )); filterSubChar; charToSub )
& antiFilter ( textToFilter; filterAllow; filterSubChar; start + 1 )



Log in to post comments.


Note: these functions are not guaranteed or supported by Please contact the individual developer with any questions or problems.

Support this website.

This library has been a free commmunity resource for FileMaker users and developers for 15 years. It receives no funding and has no advertisements. If it has helped you out, I'd really appreciate it if you could contribute whatever you think it's worth:

Under construction. Email me your wish list for improvements.