1

I need to extract the arguments from a function Say, Function_1(arg1,agr2,....argn).

Is it possible to strip the arguments alone with out brackets.

I tried using \([\w,]*\) expression

Gia Glass
  • 119
  • 5

2 Answers2

2

If you want to "catch" the matches you need to put braces around them:

 \(([\w,]*)\)

This way you will find everything arg1,arg2 in $1.

arnep
  • 5,971
  • 3
  • 35
  • 51
1

use this Regular Expression (?<=[\w]*\()[\w,]*(?=\)) to solve the purpose

gout
  • 802
  • 10
  • 32
  • What language have you tested this on? – nhahtdh Jun 26 '12 at 07:19
  • 1
    The answer is using variable-width look-behind, which is only supported in C#. http://stackoverflow.com/questions/3159524/why-doesnt-finite-repetition-in-lookbehind-work-in-some-flavorsp – nhahtdh Jun 26 '12 at 07:23