Being the RegEx Ninja, my first thought is to use a regex:

([a-z0-9])\1

will find any instance of a character next to itself, so if you refind() 
for it across your string, you can find the repeating chars.

--Ben Doom


Kenny Kinds wrote:
> I'm writing code to verify if a string that is entered complies with certain 
> criteria.
> 
> The criteria are
> 
> the first four characters must have at least one alphanumeric character and 
> one numeric character and the last 4 digits must have the same.
> 
> Also, the string cannot have two repeating alphanumeric or numeric 
> characters. ex. 'AA'
> 
> I've written the first part, but i'm having trouble with the repeating 
> characters.
> 
> Can anyone point me in the right direction on how I can accomplish this?
> 
> Thanks 
> 
> 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Create robust enterprise, web RIAs.
Upgrade to ColdFusion 8 and integrate with Adobe Flex
http://www.adobe.com/products/coldfusion/flex2/?sdid=RVJP

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:289294
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4

Reply via email to