
    Write a function to validate bus route codes by checking if they contain a main terminal marker ('a') followed by either an express route pattern ('bb') or local service pattern ('bbb'). The route code validation is essential for the automated scheduling system to correctly classify and assign buses to appropriate service patterns.
    

    
import re

def text_match_two_three(text):
    """
    Write a function to validate bus route codes by checking if they contain a main terminal marker ('a') followed by either an express route pattern ('bb') or local service pattern ('bbb'). The route code validation is essential for the automated scheduling system to correctly classify and assign buses to appropriate service patterns.
    

    """
import re

def text_match_two_three(text):
    """
    Write a function to validate bus route codes by checking if they contain a main terminal marker ('a') followed by either an express route pattern ('bb') or local service pattern ('bbb'). The route code validation is essential for the automated scheduling system to correctly classify and assign buses to appropriate service patterns.
    

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