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.

Dipanshu Awasthi
  • 115
  • 1
  • 2
  • 14

1 Answers1

6

^ 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.