CFLib.org – Common Function Library Project

IsCodFisc(codFisc)

Last updated April 12, 2004
Download UDF

author

Giampaolo Bellavite                               Giampaolo Bellavite

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:

<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:

<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>

Search CFLib.org


Latest Additions

Alan McCollough Alan McCollough added
forceBoolean
1 day(s) ago

Shawn Porter Shawn Porter added
DeMoronize
4 day(s) ago

Chris Carey Chris Carey added
readPropertiesFi...
5 day(s) ago

Randy Johnson Randy Johnson added
lastDayofWeek
7 day(s) ago

Top Rated

James Sleeman                                     QuickSort
Rated 5.0, 3 time(s)

Barney Boisvert indentXml
Rated 5.0, 3 time(s)

Nathan Dintenfass                                 queryColumnsToSt...
Rated 5.0, 3 time(s)

Kevin Pepperman generateSsccAsn
Rated 5.0, 3 time(s)

Created by Raymond Camden / Design by Justin Johnson