I have my input data utf8 encoded.
I'm applying a regular expression on the input to find everything before the comma.
However my regex returns None
, though I can see the comma visually.
What's wrong with it?
I tested if ','
in MyString
, which works fine.
Here is my input data:
ID MyString
765427 Units G2 and G3, kings Drive
207162 Unit 5/165,Elizabeth Palace
47568 Unit 766 - 767 Gate 7,Jacks Way,
15498 Unit F, Himalayas Street,
As per my regex - re.search(r".*?,", s['MyString'])
,
I expect my output to be:
ID MyString
765427 Units G2 and G3,
207162 Unit 5/165,
47568 Unit 766 - 767 Gate 7,
15498 Unit F,
But what I am getting is:
ID MyString
765427 Units G2 and G3,
207162 None
47568 Unit 766 - 767 Gate 7,
15498 None
Please correct if my understanding is right on the regex. Else what's wrong. I can't figure out whats wrong with this.