
    Write a function that checks whether a transaction description contains a primary merchant code followed by either two or three sequential security tokens, where the primary code is represented by 'a' and security tokens by 'b' characters in the validation sequence.
    

    
import re

def text_match_two_three(text):
    """
    Write a function that checks whether a transaction description contains a primary merchant code followed by either two or three sequential security tokens, where the primary code is represented by 'a' and security tokens by 'b' characters in the validation sequence.
    

    """
import re

def text_match_two_three(text):
    """
    Write a function that checks whether a transaction description contains a primary merchant code followed by either two or three sequential security tokens, where the primary code is represented by 'a' and security tokens by 'b' characters in the validation sequence.
    

    """
    patterns = 'ab{2,3}'
    if re.search(patterns, text):
        return True
    else:
        return False