I may have answered my own question, putting what I did here incase anyone else has a similar question in the future.
I used indexOf to check for the desired input characters then used an if/else statement to either count the number of desired characters or set the variable to 0.
This appears to be working, if anyone else has a more elegant solution let me know.
Thanks!
//defines the variables
txt = thisComp.layer("Overlay TXT Here").text.sourceText;
//statement body
if (txt.indexOf("e"|"f"))
a = (txt.match(/e|f/g)||[]).length
else
a=0;
//print total value
a