java - How can I count the number of a special character in a regular expression? -


well, i'm beginner in working regular expressions , wanna design program language contains of , b ( mean want accept words using , b.) starts counting number of a, , b in expression enter. don't know methods useful in case...

you cannot count occurances of character x in string regular expressions. can validate fixed number n of x present. make familiar regular, context free , context sensitive grammars.

you should use java.util.scanner, tokenize input , count it.


Comments

Popular posts from this blog

facebook - android ACTION_SEND to share with specific application only -

python - Creating a new virtualenv gives a permissions error -

javascript - cocos2d-js draw circle not instantly -