CFLib.org – Common Function Library Project

IsCodFisc(codFisc)

Last updated April 12, 2004

Version: 1 | Requires: ColdFusion 5 | Library: FinancialLib

 
Rated 0 time(s). Average Rating: 0

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

Return Values:
Returns a boolean.

Example:

view plain print about
<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:

view plain print about
<cfscript>
/**
 * 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));
}
</cfscript>
blog comments powered by Disqus

Search CFLib.org


Latest Additions

Tayo Akinmade Tayo Akinmade added
arrayTrim
4 day(s) ago

Will Belden Will Belden added
longTime
9 day(s) ago

James Sleeman James Sleeman added
quickSort
19 day(s) ago

Ben Forta Ben Forta added
GetHostAddress
22 day(s) ago

Top Rated

Darwan Leonardo Sitepu EksporSQLData
Rated 5.0, 16 time(s)

Darwan Leonardo Sitepu backupDatabase
Rated 5.0, 13 time(s)

Barney Boisvert indentXml
Rated 5.0, 10 time(s)

Kevin Pepperman generateSsccAsn
Rated 5.0, 4 time(s)

Created by Raymond Camden / Design by Justin Johnson