I am using Ubuntu 14.04, 16.04 and 18.04. LibreOffice version 4.x to 6.x. There is a data like New Zeland Vs South Africa in a cell I need a formula which will extract data like New Vs South means first word of the cell then Vs then first word after Vs
1 Like
Hallo
=REGEX(A1;"^(\w+).* (Vs) (\w+).*";"$1 $2 $3")
quite old … but REGEX should work since LO6.4
2 Likes
May be something like this…
=REGEX(A1,"^(\w+).* Vs (\w+).*","$1 Vs $2")
3 Likes
Thanks a lot it works
What if sometimes there is a single space before and after Vs and sometines diuble space before and after Vs. Please suggest a single formula that works in both cases.
one or more space is \s+ so the updated function:
=REGEX(A1,"^(\w+).* Vs\s+(\w+).*","$1 Vs $2")
1 Like