
    Write a function that analyzes hospital emergency alert codes to identify resource demand patterns where an emergency trigger ('a') is followed by either two consecutive resource demand indicators ('b') for moderate situations or three consecutive indicators for high-demand scenarios. The function should help hospital administrators quickly determine appropriate resource allocation levels during peak emergency hours.
    

    
import re

def text_match_two_three(text):
    """
    Write a function that analyzes hospital emergency alert codes to identify resource demand patterns where an emergency trigger ('a') is followed by either two consecutive resource demand indicators ('b') for moderate situations or three consecutive indicators for high-demand scenarios. The function should help hospital administrators quickly determine appropriate resource allocation levels during peak emergency hours.
    

    """
import re

def text_match_two_three(text):
    """
    Write a function that analyzes hospital emergency alert codes to identify resource demand patterns where an emergency trigger ('a') is followed by either two consecutive resource demand indicators ('b') for moderate situations or three consecutive indicators for high-demand scenarios. The function should help hospital administrators quickly determine appropriate resource allocation levels during peak emergency hours.
    

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