使用正则表达式匹配JS函数代码
String someFunction="init";
Pattern regex = Pattern.compile(
"function\s*?"+someFunction+"\(.*?\)\s*?\{[^{}]*?(\{.*?\})*[^{}]*?\}"
, Pattern.DOTALL | Pattern.CASE_INSENSITIVE | Pattern.UNICODE_CASE | Pattern.MULTILINE);
使用正则表达式匹配JS函数代码
String someFunction="init";
Pattern regex = Pattern.compile(
"function\s*?"+someFunction+"\(.*?\)\s*?\{[^{}]*?(\{.*?\})*[^{}]*?\}"
, Pattern.DOTALL | Pattern.CASE_INSENSITIVE | Pattern.UNICODE_CASE | Pattern.MULTILINE);