Regular expressions usually in the use of string processing time is more commonly used, the individual feel that do not need to deliberately to understand, with the words to take out the document to check the good, the following to a link
Http://www.php100.com/manual/Javascript/html/jsgrpRegExpSyntax.htm
This is a regular expression of the document, when you can go to check, the following with a small example of familiar with, the function is to input a string of strings, output the number of numbers, the code is relatively simple:
ImportJava.util.Scanner;ImportJava.util.regex.Matcher;ImportJava.util.regex.Pattern; Public classReg_test1 { Public Static voidMain (string[] args) {Reg_test1 rt=NewReg_test1 (); Rt.function (); } Public voidfunction () {intCount = 0; Pattern P= Pattern.compile ("(\\d+)"); Scanner s=NewScanner (system.in); Matcher m=P.matcher (S.nextline ()); while(M.find ()) {count++; } System.out.println (count); }}
The regular expression of Java programming