We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent b3bf673 commit db7a072Copy full SHA for db7a072
src/main/java/org/jsoup/helper/Re2jRegex.java
@@ -18,6 +18,8 @@ public static Regex compile(String regex) {
18
return new Re2jRegex(com.google.re2j.Pattern.compile(regex));
19
} catch (RuntimeException e) {
20
throw new ValidationException("Pattern syntax error: " + e.getMessage());
21
+ } catch (OutOfMemoryError | StackOverflowError e) { // defensive check on regex to normalize exception
22
+ throw new ValidationException("Pattern complexity error: " + e.getMessage());
23
}
24
25
0 commit comments