import re


def split_words_and_quoted_text(text):
    """Split string text by space unless it is
       wrapped inside double quotes, returning a list
       of the elements.

       For example
       if text =
       'Should give "3 elements only"'

       the resulting list would be:
       ['Should', 'give', '3 elements only']
    """
    # using shlex
    # return shlex.split(text)
    
    # using re
    result = list()
    pattern = re.findall(r'\w+\s*|\".+?\"', text)
    for char in pattern:
        result.append(char.strip().replace('"', ''))
    return result