I want to find and replace a substring beginning with string 'sps.jsp' and ending with substring 'FILE_ARRAY_INDEX=12'.
Following is my string content
beginning with strings............[sps.jsp]..anything between.. [FILE_ARRAY_INDEX=12] ending with some strings....
Below is my code
Pattern r = Pattern.compile("sps.jsp[\\s\\S]*?FILE_ARRAY_INDEX=12");
Matcher m = r.matcher(InputStr);
if (m.find( ))
{
System.out.println("Found value: " + m.group() );
}
I'm not able to get my pattern and replace it with a new string.