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
Post a Comment