我想從字符串中刪除$ {anything}或$ {somethingelse},但是我找不到正則表達式。
我的實際代碼
String url = http://test.com/index.jsp?profil=all&value=${value}
String regex = "\\$\\{*\\}";
url = url .replaceAll(regex, ""); // expect http://test.com/index.jsp?profil=all&value=
//but it is http://test.com/index.jsp?profil=all&value=${value}
我敢肯定,解決的辦法是愚蠢的,但沒有辦法找到。
它的工作原理!謝謝 ! – Antoine 2010-10-01 16:21:34
@Antoine Meausoone然後標記答案爲接受(在投票櫃檯下面打勾) – Bozho 2010-10-01 16:25:12
是的,我不得不等待15分鐘,thx又保存了我的週末:) – Antoine 2010-10-01 16:30:07