CFLib.org – Common Function Library Project

isPostalCodeBE(str)

Last updated October 06, 2005

author

Peter J. Farrell

Version: 1 | Requires: CF5 | Library: StrLib

Description:
Checks if valid Belgium postal code. Does not actually check if the postal code exists, but merely the format.

Return Values:
Returns a boolean.

Example:

<cfoutput>
#isPostalCodeBE(0111)# (will be false)<br/>
#isPostalCodeBE(9999)# (will be true)<br/>
</cfoutput>

Parameters:

Name Description Required
str String to check. Yes

Full UDF Source:

/**
 * Checks if valid Belgium postal code.
 * 
 * @param str      String to check. (Required)
 * @return Returns a boolean. 
 * @author Peter J. Farrell (pjf@maestropublishing.com) 
 * @version 1, October 6, 2005 
 */
function isPostalCodeBE(str) {
    // Postal codes cannot start with 0
    return REFind("[1-9][[:digit:]]{3}", arguments.str) gte 1;
}

Search CFLib.org


Latest Additions

Raymond Camden added
QueryDeleteRows
November 04, 2017

Leigh added
nullPad
May 11, 2016

Raymond Camden added
stripHTML
May 10, 2016

Kevin Cotton added
date2ExcelDate
May 05, 2016

Raymond Camden added
CapFirst
April 25, 2016

Created by Raymond Camden / Design by Justin Johnson