正则表达式查找Javascript函数 [英] regex to find Javascript functions

查看:88
本文介绍了正则表达式查找Javascript函数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

我有一个任务,需要在* .js文件中显示所有方法名称.
我已经尝试了很多方法,但是找不到解决方案.n现在,我想为Java脚本函数提供一个正则表达式,以便获得这些匹配案例的名称.

请帮帮我

Hi everyone ,

I have a task in which I need to show all the methodnames in a *.js file.
I have tried many ways but I couldn''t find a solution.n Now I want to have a regex for java script functions, so that I can get names of those matched cases.

Please help me out

推荐答案

如果您使用的是.Net,则可以将javascript加载到BrowserWindow中,然后使用DOM提取方法名称(让DOM为您解析).您将如何进行此操作,我将作为编程练习留给您.
If you''re using .Net, you can probably load the javascript into a BrowserWindow, and then use the DOM to extract the method names (let the DOM do the parsing for you). How you would specifically go about doing this, I leave to you as a programming exercise.


这篇关于正则表达式查找Javascript函数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆