May-19-2022, 10:05 PM
(This post was last modified: May-19-2022, 10:05 PM by Pedroski55.)
Ah well, I presumed you would only be receiving frequency data as Hertz from some CIA outpost in Alaska!
Maybe the spooks are also sending recipe data to their mothers. oz, lbs
Maybe the spooks are also sending recipe data to their mothers. oz, lbs
measurements = ['2.5hz','2.5Hz', '2.5mHz', '2.5GHz', '2.5THz', '2.5mTHz', '2.5', 'h', 'HZ', 'Hz' ] my_pattern = re.compile("[a-z, A-Z]") for m in measurements: # if there is no text try: start_pos = my_pattern.search(m).span()[0] print('measured frequency is', m) start_pos = my_pattern.search(m).span()[0] print('number =', m[:start_pos], 'units =', m[start_pos:]) except AttributeError: continue