3 Replies Latest reply on Jun 1, 2008 3:13 AM by 807591

    String replaceFirst

    807591
      Hi,
      I have some string in the form .* <% .* %> .* <% .* %> .* etc.
      example:
      <h1>Hello <% out.print(params.get("name")[0]); %>!</h1> <% for%> Hello2

      I want to erase from the string all the characters until the first "<%".
      I have tried to use str.replaceFirst(".*<%","");
      but then it cuts all the string till the last "<%" (i.e. gives me the string " for%> Hello2").
      what can I do?

      thanks