I need help with regex or Python to extract a substring from a set of strings. A string consists of alphanumeric characters. I just want the substring to start after the first space and end before the last space, as shown below.
Example 1: A:01 What is the date of the election ? BK:02 How long is the river Nile ? Results: What is the date of the election How long is the river Nile
While I'm in, is there an easy way to extract strings before or after a specific character? For example, I want to extract a date or day, as from a string similar to the one shown in Example 2.
Example 2: Date:30/4/2013 Day:Tuesday Results: 30/4/2013 Tuesday
I really read about regex, but this is very alien to me. Thanks.
source share