CFLib.org – Common Function Library Project

IsCodFisc(codFisc)

Last updated April 12, 2004

author

Giampaolo Bellavite

Version: 1 | Requires: CF5 | Library: FinancialLib

Description:
Check if a string is a well formed italian Fiscal Code, useful for validating purposes.

Return Values:
Returns a boolean.

Example:

<cfset myCode="BLLGPL79P19L781S">
<cfoutput>
Is #myCode# a well formed italian fiscal code? #YesNoFormat(IsCodFisc(myCode))#.
</cfoutput>

Parameters:

Name Description Required
codFisc Financial code. Yes

Full UDF Source:

/**
 * Check if a string is a well formed italian Fiscal Code.
 * 
 * @param codFisc 	 Financial code. (Required)
 * @return Returns a boolean. 
 * @author Giampaolo Bellavite (giampaolo@bellavite.com) 
 * @version 1, April 12, 2004 
 */
function IsCodFisc(codFisc) {
	return ReFind("^[A-Z]{6}\d{2}[A-Z]\d{2}[A-Z]\d{3}[A-Z]$", trim(codFisc));
}
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