Regular Expression to get only words from file starting with letter and removing words with only numbers and punctuation in python
<p>I have a text file which i am reading in python through nltk functions.
I need to get only only words from file starting with letter and removing words with only numbers and punctuation.
For ex :-</p>

<pre><code>['Osteama pranay@123  123 !']
</code></pre>

<p>so the desired output is</p>

<pre><code>Osteama pranay@123
</code></pre>

<p>Please suggest a regular expression for this</p>

<pre><code>import re
' '.join(re.findall(r'\b[a-z][^\s]*\b', 'Osteama pranay@123  123 !', re.I))
</code></pre>

<p>the same regexp used with nltk.RegexpTokenizer</p>

<pre><code>import nltk 
tokenizer = RegexpTokenizer(r'[a-zA-Z][^\s]*\b')
nltk.tokenize('Osteama pranay@123  123 !')
</code></pre>

python regex nltk regex-negation