Reputation: 7048
I have a cell in E13 which contains numbers and numbers between brackets. What I want to acheive is to match the number and copy to another cell and delete the match from E13.
E13
0:08.63 [6]
I want E13 to be
0:08.63
And in M13 I want
6
Based on this example https://support.google.com/docs/answer/3098244?hl=en
=REGEXEXTRACT(A4, "\(([A-Za-z]+)\)")
I tried this in M13
=REGEXEXTRACT(E13,\([[0-9]+]\))
Then based on this SO answer https://stackoverflow.com/a/2403159/461887
=REGEXEXTRACT(E13,\[(.*?)\])
But in both cases I just get an error.
Upvotes: 0
Views: 8635
Reputation: 4567
You are just getting a basic syntax error. The minimal help for REGEXEXTRACT
shows that the regexp must be enclosed in double quotes. Your second expression works correctly then:
=REGEXEXTRACT(E13,"\[(.*?)\]")
Upvotes: 1
Reputation: 50462
SPLIT by the space:
=SPLIT(E13," ")
REGEX:
=REGEXEXTRACT(E13,"(\S+)\s+\[(\d+)\]")
Upvotes: 2