Changed ReturnCountExtended to use RegExp