extracting and listing word in python
Question: i have difficult to do this project python script to extract and list all
words that meets the following conditions:  
(1) words with two consonants next to each other.  
(2) words of length 5 or more that start and ends with a vowel.  
(3) words of length 7 or more that starts with consonant and ends with a
vowel.  
(4) Abbreviate 2-3 words that all start with a capital letter.  

Any pointers on how to code this, helps, or even code examples would be much
appreciated. need your help.


Answer: First, how to include regular expressions in a Python program:

    
    
    import re
    
    if re.match(pattern, string_to_match):
        # there is a match
    else:
        # there is no match
    

Then, the first regular expression you need. As you haven't given any code,
and this question smells of homework I won't give you the others.

    
    
     re.match(r"^[aeiou].{,3}[aeiou]$", string_to_match)
    

Explanation:

The `^` and `$` ensure that the match is from the beginning to end of the
string. The `[aeiou]` checks for a character that is a vowel. The `.{,3}`
checks for up to 3 repetitions of any character (represented by `.`).

You may find the [documentation](http://docs.python.org/3/library/re.html)
helpful.

