Java String.replaceAll regex
- by atomsfat
I want to replace the first context of
web/style/clients.html
with the java String.replaceFirst method so I can get:
${pageContext.request.contextPath}/style/clients.html
I tried
String test = "web/style/clients.html".replaceFirst("^.*?/", "hello/");
And this give me:
hello/style/clients.html
but when I do
String test = "web/style/clients.html".replaceFirst("^.*?/", "${pageContext.request.contextPath}/");
gives me
java.lang.IllegalArgumentException: Illegal group reference