An example of a regular expression

xiaoxiao2021-03-05  23

String a = "

http://www.dd.com/1.mp3/">http://wds.mp3 ";

String RE = "<

// s * a // s href // s * = // s * / "| // s * /" // s *> | <(. [^>] *)> "; // take address Chinese

String regex = "<

// s * a // s href // s * = // s * / "| // s * /" // s *> "; // take the address

String reg = "<(. [^>] *)>"; // Take Chinese

Pattern P = Pattern.Compile (RE);

Matcher math = p.matcher (a);

Stringbuffer BS = new stringbuffer ();

Boolean b = math.find ();

While (b) {

Math.AppendReplacement (BS, ");

B = math.find ();

}

Math.AppendTail (BS);

System.out.println (BS);

转载请注明原文地址:https://www.9cbs.com/read-34760.html

New Post(0)