I am looking to parse patterns like "w x h x l" using regex, so basically the letters w,h,l (and others) with "x" in between. There could be text around the searched expression, and "w x h x l x l x h" would be valid as well.
I have tried the regular expression
(w|h|l|b)(\\s\*x\\s\*(w|h|l|b))+
but I don't understand why this doesn't work.
Examples (with python's re.findall):
"The measurements are (w x h x l): 5x7x3cm" => [(w,h,l)]
"Measurement options are (wxhxl), (hxlxb): Some random stuff" => [(w,h,l),(h,l,b)]
"The measurements, in form wxhxl: 5x7x3cm" => [(w,h,l)]