newbie question
torjon_at_NOSPAMnterport.net
Date: 08/14/04
- Next message: Gunnar Hjalmarsson: "Re: newbie question"
- Previous message: kr: "Re: array slice question"
- Next in thread: Gunnar Hjalmarsson: "Re: newbie question"
- Reply: Gunnar Hjalmarsson: "Re: newbie question"
- Reply: Jürgen Exner: "Re: newbie question"
- Reply: Joe Smith: "Re: newbie question"
- Reply: torjon_at_NOSPAMnterport.net: "Re: newbie question"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Fri, 13 Aug 2004 22:34:42 GMT
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!
- Next message: Gunnar Hjalmarsson: "Re: newbie question"
- Previous message: kr: "Re: array slice question"
- Next in thread: Gunnar Hjalmarsson: "Re: newbie question"
- Reply: Gunnar Hjalmarsson: "Re: newbie question"
- Reply: Jürgen Exner: "Re: newbie question"
- Reply: Joe Smith: "Re: newbie question"
- Reply: torjon_at_NOSPAMnterport.net: "Re: newbie question"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|
|