Regex to match specific functions and their arguments in files

前端 未结 6 1862
没有蜡笔的小新
没有蜡笔的小新 2021-01-16 07:33

I\'m working on a gettext javascript parser and I\'m stuck on the parsing regex.

I need to catch every argument passed to a specific method call _n( and

6条回答
  •  醉话见心
    2021-01-16 07:57

    Below regex should help you.

    ^(?=\w+\()\w+?\(([\s'!\\\)",\w]+)+\);
    

    Check the demo here

提交回复
热议问题