CFLib.org – Common Function Library Project

isPostalCodeBE(str)

Last updated October 6, 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;
}
blog comments powered by Disqus

Search CFLib.org


Latest Additions

Kevin Cotton added
date2ExcelDate
May 5, 2016

Raymond Camden added
CapFirst
April 25, 2016

Chris Wigginton added
loremIpsum
January 18, 2016

Gary Stanton added
calculateArrival...
November 19, 2015

Sebastiaan Naafs - van Dijk added
getDaysInQuarter
November 13, 2015

Created by Raymond Camden / Design by Justin Johnson