Link to home
Start Free TrialLog in
Avatar of Errol Farro
Errol FarroFlag for Aruba

asked on

Specific String search Coldfusion

Hi all,

Can someone help me create the following CF Function?

We receive payments from clients but the client number can be anywhere in the description.
The naming convention of the client number is: yyyynnn where yyyy is the year and nnn is a sequence number between 001 and 999. The year can be between 1960 and the current year. There may be other numbers in the description but the client number should be returned only when the above criteria is met.

Thanks in advance.

Errol
Avatar of _agx_
_agx_
Flag of United States of America image

You'll likely need a regex. You should add that topic to the question tags to attract attention from the right experts. (I'm not a regex guru so I'll leave this to someone more qualified :)
ASKER CERTIFIED SOLUTION
Avatar of Sudhindra A N
Sudhindra A N
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Errol Farro

ASKER

Thanks a lot Ansudhindra. Works like a charm....
> "[\d]+"

May as well search for 7 digits exactly instead of *any* number of digits.

And if you go with a cffunction, don't forget to VAR scope all those variables... or you can end up creating weird threading bugs in some cases.