Skip to content

Commit

Permalink
Improving regex to cover additional cases
Browse files Browse the repository at this point in the history
  • Loading branch information
abpai94 committed Sep 16, 2024
1 parent 29338eb commit e5ef3f1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/main/java/org/lsc/utils/ScriptingEvaluator.java
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ private ScriptableEvaluator identifyScriptingEngine(String expression) throws Ls
*/
public String matchJScriptEvaluator(String jscript) {
for (String jscriptEngine : instancesTypeCache.keySet()) {
Pattern pattern = Pattern.compile("\\n.*" + jscriptEngine);
Pattern pattern = Pattern.compile("((\\n.*)+)" + jscriptEngine);
if (pattern.matcher(jscript).matches()) {
return jscriptEngine;
}
Expand Down

0 comments on commit e5ef3f1

Please sign in to comment.