0

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.

sayth
  • 6,696
  • 12
  • 58
  • 100

2 Answers2

2

SPLIT by the space:

=SPLIT(E13," ")

REGEX:

=REGEXEXTRACT(E13,"(\S+)\s+\[(\d+)\]")
TheMaster
  • 45,448
  • 6
  • 62
  • 85
1

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,"\[(.*?)\]")
E_net4
  • 27,810
  • 13
  • 101
  • 139
ttarchala
  • 4,277
  • 2
  • 26
  • 36