1

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.

1 Answer 1

1

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.