I have an attribute field that contains strings like "iuyluf45567kjyyr347fklj". All strings contain various amount of characters and digits (there is no clear pattern) but each string contains 2 groups of numbers. I have to extract those numbers as new attributes. I managed to extract first number using Field Calculator:
regexp_substr('iuyluf45567kjyyr347fklj', '(\\d+)')
gives me 45567.
But I have no idea how to extract the second one.
Add a comment
|
1 Answer
You can try
regexp_substr('iuyluf45567kjyyr347fklj', '(\\d+)[^\\d]*$')
It will look for one or more digit that does not contain another digit between it and the end of the string