Regex: Match Fullstop And One Word In Python
I am new to regex. I wish to write a regex which matches a '.' followed by a whitespace followed by a word(which does not contain whitespace. For example, in the string 'The sound
Solution 1:
import re
input = 'The sound of cracking. Splintering. A shape appears, in ice.'print re.findall("(\.\s+[a-zA-Z]+)", input)
Output: ['. Splintering', '. A']
Post a Comment for "Regex: Match Fullstop And One Word In Python"