
    Write a function to validate whether a traffic signal sequence contains a green light state followed by either a standard (two-phase) or extended (three-phase) yellow light transition pattern. The sequence will be represented as a string where 'a' indicates a green light state and 'b' indicates a yellow light phase, and the function must verify if there is at least one instance of a green light followed by either two or three yellow light phases.
    

    
import re

def text_match_two_three(text):
    """
    Write a function to validate whether a traffic signal sequence contains a green light state followed by either a standard (two-phase) or extended (three-phase) yellow light transition pattern. The sequence will be represented as a string where 'a' indicates a green light state and 'b' indicates a yellow light phase, and the function must verify if there is at least one instance of a green light followed by either two or three yellow light phases.
    

    """
import re

def text_match_two_three(text):
    """
    Write a function to validate whether a traffic signal sequence contains a green light state followed by either a standard (two-phase) or extended (three-phase) yellow light transition pattern. The sequence will be represented as a string where 'a' indicates a green light state and 'b' indicates a yellow light phase, and the function must verify if there is at least one instance of a green light followed by either two or three yellow light phases.
    

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