How to drop all digits from string with exceptions using Regex?
Sep 9, 2020 9:06 AM(100 views)
I want to clean up a free text filed column for text analysis and am trying to drop all digits except when followed by a specific letter. In the example below, I want to drop the first numbers but keep both 120f and 119 f, as they are meaningful values.
Using the following regex:
"14.300.114 .temperature is not 120f but 119 f...";
Show( Phrase );
Regex( Phrase, "\d+([^\d+(f|\sf)])", "", GLOBALREPLACE );
gives me this result:
"114 .temperature is not 120f but 119 f...". The remperatures are succesfully kept, but not all digits from the first digit string are droppped.