
    Write a function to validate student learning progression patterns by checking if a completed prerequisite topic is immediately followed by mastery of either two or three related skills in the learning sequence code. The sequence code uses 'a' to mark prerequisite completion and 'b' to represent each mastered related skill, where valid progressions must show the prerequisite followed by either two or three skill masteries.
    

    
import re

def text_match_two_three(text):
    """
    Write a function to validate student learning progression patterns by checking if a completed prerequisite topic is immediately followed by mastery of either two or three related skills in the learning sequence code. The sequence code uses 'a' to mark prerequisite completion and 'b' to represent each mastered related skill, where valid progressions must show the prerequisite followed by either two or three skill masteries.
    

    """
import re

def text_match_two_three(text):
    """
    Write a function to validate student learning progression patterns by checking if a completed prerequisite topic is immediately followed by mastery of either two or three related skills in the learning sequence code. The sequence code uses 'a' to mark prerequisite completion and 'b' to represent each mastered related skill, where valid progressions must show the prerequisite followed by either two or three skill masteries.
    

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