Brian Dunning's FileMaker Custom Functions

util.TextMatchesFormat ( text_to_match ; format )

Determines if text_to_match is in the format specified

  Be the first to rate this function Log in to vote

Pip Meadway   Pip Meadway - Show more from this author
PIPCO IT

Share on Facebook Share on Twitter

  Sample input:
util.TextMatchesFormat ( "01234987654" ; "01nnnnnnnnn" )
  Sample output:
True

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

This is a simple format matching CF, for more complex formatting I would suggest using BERegularExpression () from Base Elements plug-in.

The format parameter can be a combination of literal text and placeholders for types of characters:

n any number
a any letter, upper or lower case
A-Z The specific letter, upper or lower case
_ A space
? Any character


Some examples:

a six digit number "nnnnnn"
six digits with a trailing alpha "nnnnnna"

I developed this to detect and format UK phone numbers, and I have tested it on c. 30,000 phone numbers.

 

Comments

Log in to post comments.

 

Note: these functions are not guaranteed or supported by BrianDunning.com. 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 16 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: