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

浙公网安备 33010602011771号