here is my input string:
bar somthing foo bar somthing foo
I would like to count number of a character (ex: 't') between bar & foo
bar somthing foo -> 1
bar somthing foo -> 1
I know we can use
/bar(.*?)foo/
and then count number of character in matches[1] with a String function
Is there way to do this w/o string function to count?