-1

Please note I am trying to do this in Google Sheets, which apparently uses RE2.

I am trying to extract shoe sizes from the Title, which has other numbers like Model# etc. that are being matched by Regexextract before the size. The size is usually at the end of the string, but sometimes has other characters after it, or can be wrapped in parentheses.

Sample Data:

Nike - GS AIR MAX '95 [905348-028] Anthracite/Amarillo/Black/Wolf Grey 6.5
Nike - AIR MAX 95 ERDL Party [AR4473-001] Black/Multi Color 11.5
Nike Womens Air Max Torch 4 Running Shoe (8, White/Black-Volt-Laser Crimson)
NIKE Men's Air Max 2017, Bright Crimson/Black, 8 M US
Nike Mens Air Max 97 Qs Running Shoes (11)
Nike Men's Air Max 270 React Running Shoes (Black/Oil Grey/Grey Black, 12)
Nike Men's Air Max 200 Running Sneakers (12, Habanero Red/Oil Grey)
Nike Air Max Camden Men's Slide Sandal (Black/White/Black, Numeric_12)

Desired Output:

6.5
11.5
8
8
11
12
12
12

What I have tried:

REGEXEXTRACT(A1, ".*(\d\d\.?\d.*)")
REGEXEXTRACTA1, "\(?\d\d?\.?\d?\)?\z")

Please help.

kislam
  • 9
  • 3

1 Answers1

0

Here's one approach:

=map(A:A,lambda(Σ,if(Σ="",,lookup(9^9,split(regexreplace(Σ,"[^\d.]",""),"")))))

enter image description here

rockinfreakshow
  • 15,077
  • 3
  • 12
  • 19