Sure. It follows basically the same principle.
([a-z0-9]{2}).?\1
This is, btw, a fairly inefficient regex, so I wouldn't run it against,
say, a K of data at a time, but for 8 chars, I expect the regex engine
overhead will be larger. In other words, for your purposes, it's fine.
(Not tested, YMMV)
--Ben "HoF Regex Ninja" Doom
Kenny Kinds wrote:
>> 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:
> Thanks.
>
> I have one more question as, in the string I need to check for sets of
> characters because the password cannot have more that 2 sets of the same
> letters or numbers. ex. (xy, xy).
>
> Is there a RegEx that can accomplish this?
>
> Thanks in advance.
>
>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
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:289372
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4