In QGIS 3.18. There are several similar questions such as this one which do not address my exact problem.
I have an attribute of comma-concatenated values containing text and numbers. I would like to extract all of the numbers as they are in that list, retaining the commas -- or, said differently, remove everything that is not an integer, a period (as I wish to include decimal values) or a comma. (I then wish to retain only the largest of those numbers, but that might be a separate question.)
I have attempted variations of the expression in the above-linked question, regexp_substr("My data", '(\\d+)[^\\d]*$')
, with the results in the table below; it seems decimals are not considered digits, and it doesn't seem to be taking more than one number in any case:
As an example :
My data | Desired output | Output with the above expression |
---|---|---|
1.50 | 1.50 | 50 |
0.30 (BRGM) | 0.30 | 30 |
1.28 (bassin),1.53 (pré) | 1.28,1.53 | 53 |
NR | NULL | NULL |
NULL | NULL | NULL |