karthikpa has asked for the wisdom of the Perl Monks concerning the following question:
I want to split this into tokens stored in an array(say @elems) such as$abc = abc,xyz,{1,2,3,4},18-90-89,{{1,2},{5,6,7,8}},yts
The rules are$elems[0] = abc $elems[1] = xyz $elems[2] = {1,2,3,4} $elems[3] = 18-90-89 $elems[4] = {{1,2},{5,6,7,8}} and so on.
A friend of mine told that this is beyond the scope of regexp and this is only possible using Parse::RecDescent module as this problem is similar to token parsing by the compiler.
Dear monks, please help me write perl code to achieve this effect either through a regex or by use of any module such as Parse::RecDescent.
Thanks in advance!Edited by Chady -- added formatting
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: urgent perl regexp help needed
by Sec (Monk) on Jul 20, 2005 at 15:13 UTC | |
by ikegami (Patriarch) on Jul 20, 2005 at 15:28 UTC | |
by karthikpa (Novice) on Jul 20, 2005 at 15:34 UTC | |
by karthikpa (Novice) on Jul 20, 2005 at 15:27 UTC |