I have string like this 125.67.888.66.123. I want to count number of dot operations.
123.45 => 2
3446.67.88 => 3
23.45.567.88 => 4
I write this query
SELECT REGEXP_COUNT ('188.8.131.52.1055', '.') FROM dual;
But it gives 16.How can i obtain 5 for above query.When i find exact number I will start a loop.Do you have any idea?
You need to escape
. — and to add
SELECT REGEXP_COUNT('184.108.40.206.1055', '[.]') + 1 FROM dual;