Regular Expressions in Java programming and java Regular Expressions
Regular Expressions are commonly used for string processing. I don't think you need to understand them. If you want to use them, just take out the document and check it. Here is a link.
Http://www.php100.com/manual/Javascript/html/jsgrpRegExpSyntax.htm
This is a regular expression document. You can check it when using it. The following is a small example to get familiar with it. The function is to input a string and output the number of numbers in it. The code is relatively simple:
Import java. util. imports; import java. util. regex. matcher; import java. util. regex. pattern; public class reg_test1 {public static void main (String [] args) {reg_test1 rt = new reg_test1 (); rt. function ();} public void function () {int count = 0; Pattern p = Pattern. compile ("(\ d +)"); Scanner s = new partition (System. in); Matcher m = p. matcher (s. nextLine (); while (m. find () {count ++;} System. out. println (count );}}