T
torjon
I need to divide a series of fields, abcd, into single fields.
I thought of using the pattern .{1}.{1}.{1}.{1} etc but what this
returns is:
$1 = abcdfg
$2=a
$3=b
$4=c.
Now I can work around this, just slipping $1, but I need to know how
to make a regexp that will do this. Doesn't perl view the above
regexp and say I need 1 single character 5 times, then work its way
throughthe fields?
Also, when a pattern matches in a reg exp it is stored in a variable
$1. If a regexp has three matches it is stored in $1, $2 ,$3. I need
to find the number of matches, the length of this array in order to
iterate through it, or at least I need the name of the array so i can
do a foreach..
Thanks!
I thought of using the pattern .{1}.{1}.{1}.{1} etc but what this
returns is:
$1 = abcdfg
$2=a
$3=b
$4=c.
Now I can work around this, just slipping $1, but I need to know how
to make a regexp that will do this. Doesn't perl view the above
regexp and say I need 1 single character 5 times, then work its way
throughthe fields?
Also, when a pattern matches in a reg exp it is stored in a variable
$1. If a regexp has three matches it is stored in $1, $2 ,$3. I need
to find the number of matches, the length of this array in order to
iterate through it, or at least I need the name of the array so i can
do a foreach..
Thanks!