I have a working service that uses regex sent to it and uses it to fetch a value from a string.
I can create the main method inside the class and debug regex (?<=\\().+?(?=\\){1}) and it works fine.
However, as soon as I deploy it to tomcat for testing remotely, I get the following exception:
Look-behind group does not have an obvious maximum length near index 19 (?<=\\().+?(?=\\){1}) ^
Here is the function to parse the value that is called:
private String parsePattern(String value, String pattern) { String ret = ""; Matcher m = Pattern.compile(pattern).matcher(value); while (m.find()) { ret = m.group(0); } return ret; }
What happens, does it cause it to compile in the application, but does not work in webapp?
EDIT:
This is not with any line, but the line being checked is: "(Group Camp Update)"
When called from main , the method returns "Group Camp Update" when called via webapp, it throws an exception.
source share