I would like to give some feedback about a regular expression that works for me locally but not here.
I attempt to find the first word in a given string by looking for pattern ".+|\s+|([\w|']+)\b".
As I said, the pattern works for me locally. If I run the code here I get the correct word returned for the first check, but hen the check fails.
Code used so far
import re
pattern = re.compile("\.+|\s+|([\w|']+)\b")
result = pattern.split(text)
result = [x for x in result if not (x == '' or x == None)][0]
return result
From: https://py.checkio.org/mission/first-word/solve/
HTTP_USER_AGENT:
Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:62.0) Gecko/20100101 Firefox/62.0
Created at: Oct. 17, 2018, 11:03 a.m.; Updated at: Oct. 17, 2018, 1:16 p.m.
The question is resolved.