我想要实现在Java中Java的特殊字符的正则表达式
String[] paramsToReplace = {"email", "address", "phone"};
//input URL string
String ip = "http://www.google.com?name=bob&email=okATtk.com&address=NYC&phone=007";
//output URL string
String op = "http://www.google.com?name=bob&email=&address=&phone=";
URL中使用正则表达式以下可以包含特殊字符,如%
如下这将返回不正确的输出:http://www.google.com?name=bob&email=& – user1093296
@ user1093296我不t看到任何不正确的输入。你能指定吗?在我的测试中,我得到了'http://www.google.com?name = bob&email =&address =&phone =',就像您在文章中所要求的一样。 – Thomas
http://www.google.com?name=bob&email=& – user1093296