1

I have a column in Google Spreadsheets that have full names. It looks like this:

Full_name
Acacio Bernardo
Carlos Moraes
André da Silva

I need to make it look like this:

Full_name           First_name
Acacio Bernardo     Acacio
Carlos Moraes       Carlos
André da Silva      André

I'm using the following:

=regexextract(B1;"\w*")

It works fine for the first two names ("Acacio" and "Carlos"), however in the third one instead of "André" I'm getting "Andr". I noticed that this regex expression doesn't work with accents and latin characters.

I tried to apply the regex in this post however seems that google spreadsheets doesn't support it (I get straight to an error, couldn't even explore it a little further).

Can someone help?

aabujamra
  • 4,494
  • 13
  • 51
  • 101

1 Answers1

2

Use \S (non-space characters class) instead of \w:

=REGEXEXTRACT(A1, "\S+")

Result:

enter image description here

Kos
  • 4,890
  • 9
  • 38
  • 42