Largins has asked for the wisdom of the Perl Monks concerning the following question:
I was wondering if there is either a regex that will parse a string like strtol. I have the following string:
"[(58)(4)] Federal Census [(60)(3)] County/Parish, (File 1 of X)"
I used:
my @values = split(" ", $_);
to split on space, but if there is a '[' in the array element, I want to extract the numbers
for exmple from [(60)(3)] i want the 60 and then the 3, one at a time.
i have never been really good with regular expressions. There so easy to use, someone wrote a book about them
Thanks in advance
Largins
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: perl equiv regex for C strtol
by toolic (Bishop) on May 01, 2012 at 00:49 UTC | |
by Largins (Acolyte) on May 01, 2012 at 01:19 UTC | |
|
Re: perl equiv regex for C strtol
by GrandFather (Saint) on May 01, 2012 at 00:44 UTC | |
by Largins (Acolyte) on May 01, 2012 at 01:14 UTC | |
by Anonymous Monk on May 01, 2012 at 06:36 UTC | |
|
Re: perl equiv regex for C strtol
by Marshall (Canon) on May 01, 2012 at 02:14 UTC | |
by Anonymous Monk on May 01, 2012 at 06:39 UTC | |
by Marshall (Canon) on May 01, 2012 at 10:01 UTC | |
by Anonymous Monk on May 01, 2012 at 10:08 UTC | |
by Marshall (Canon) on May 01, 2012 at 10:26 UTC | |
|
Re: perl equiv regex for C strtol
by locked_user sundialsvc4 (Abbot) on May 01, 2012 at 02:06 UTC |