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));
}

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