At 8:15 PM -0600 1/26/11, Greg J wrote:
I am trying to extract numeric values from a data file and I'm having
trouble writing a regular expression that would do this.

My data looks like this: <{5, 26}{20, 42, 64}{23, 48}>

I am trying to turn this into a list of lists [ [5, 26], [20, 42, 64],
[23,48] ]

Any pointers would be greatly appreciated

I would use the Text::Balanced module to extract the characters between braces and the split function to extract the numbers separated by commas.

perldoc Text::Balanced
perldoc -f split

--
Jim Gibson
j...@gibson.org

--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/


Reply via email to