fork(1) download
  1. import re
  2.  
  3. regex = r"(?<!\S)(\d+\.\d+)x(\d+\.\d+)x(\d+\.\d+) [cm]m(?!\S)"
  4. test_str = "The study reveals a speculated nodule with pleural tagging at anterior basal segment of LLL, measured 1.9x1.4x2.0 cm in size"
  5.  
  6. print(re.findall(regex, test_str))
Success #stdin #stdout 0.02s 9648KB
stdin
Standard input is empty
stdout
[('1.9', '1.4', '2.0')]