2

I came through an expression -

select * from table where regexp_like(field, '^\d+\D+$');

I'm sure of what the expression does, but please can someone explain what '^\d+\D+$' refers to exactly?

Thanks.

1 Answer 1

7

^ beginning of string

\d single digit

+ one or more occurrences of preceding

\D nondigit character

+ one or more occurrences

$ end of string

So, it means one or more digits followed by one or more nondigits, and that should be the whole string, not a substring.

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.