Replace letters a-z with blank space or count just the digits


In the Server Action I am trying to set a value in my action to remove the letters in a strong (a-z) and replace them with empty space.
Essentially I am just trying to count only digits in a string. So I thought I would first remove the letters a-z and then use Word Count to count the digit remaining.
I can’t get this to work.
Whats the best way to do this.

For example the string ‘Wappler 2022’, I would want to strip/remove all the alphabet letters and leave only 2022 and then count 2022.

Community Page
Last updated: