I want to count the number of matches there is on one single line (or all lines as there always will be only one line).
I want to count not just one match per line as in
This might work for you:
sed -n -e ':a' -e 's/123//p' -e 'ta' file | sed -n '$='
GNU sed could be written:
sed -n ':;s/123//p;t' file | sed -n '$='