import re

regex = r"\b(?P<weight>\d+)\"\s*w\s*x\s*(?P<depth>\d+)\"\s*d\s*x\s*(?P<height>\d+)\"\s*h\b"

s = "84\" w x 39\" d x 37\" h"

matches = re.finditer(regex, s)

for matchNum, match in enumerate(matches, start=1):
        weight = match.group("weight")
        depth = match.group("depth")
        height = match.group("height")

        print(weight, depth, height)