
    Write a function that determines if a user's social interaction sequence contains a "like" action followed by either two or three consecutive "shares" on the same post, as this pattern indicates strong content affinity and can be used for friend recommendations. The function should analyze the interaction history string where 'a' represents a like action and 'b' represents a share action.
    

    
import re

def text_match_two_three(text):
    """
    Write a function that determines if a user's social interaction sequence contains a "like" action followed by either two or three consecutive "shares" on the same post, as this pattern indicates strong content affinity and can be used for friend recommendations. The function should analyze the interaction history string where 'a' represents a like action and 'b' represents a share action.
    

    """
import re

def text_match_two_three(text):
    """
    Write a function that determines if a user's social interaction sequence contains a "like" action followed by either two or three consecutive "shares" on the same post, as this pattern indicates strong content affinity and can be used for friend recommendations. The function should analyze the interaction history string where 'a' represents a like action and 'b' represents a share action.
    

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