Please help with regexp - finding all matches?
From: Boris Pelakh (pelakh_at_yahoo.com)
Date: 04/08/04
- Next message: Jürgen Exner: "Re: Please help with regexp - finding all matches?"
- Previous message: The Dead Bishop: "Re: HTTP File Posting"
- Next in thread: Jürgen Exner: "Re: Please help with regexp - finding all matches?"
- Reply: Jürgen Exner: "Re: Please help with regexp - finding all matches?"
- Reply: Jim Gibson: "Re: Please help with regexp - finding all matches?"
- Reply: Purl Gurl: "Re: Please help with regexp - finding all matches?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: 8 Apr 2004 06:35:58 -0700
I'm trying to extract name:value pairs from a string similar to this one
{a:b,c:d,e:f}
The individual pieces are more complicated, but its similar in principal
Here is a test script I use
$f = "a:b,c:d,e:f";
@a = ($f =~ m/(?:(\w+):(\w+))(?:,(?:(\w+):(\w+)))+/);
print "@a\n";
I should be seeing "a b c d e f", but I am only getting "a b e f",
i.e. the first and last group matched. Why am I not seeing the rest?
Ideally I want to just assign the result of the match to a hash.
-- Boris
- Next message: Jürgen Exner: "Re: Please help with regexp - finding all matches?"
- Previous message: The Dead Bishop: "Re: HTTP File Posting"
- Next in thread: Jürgen Exner: "Re: Please help with regexp - finding all matches?"
- Reply: Jürgen Exner: "Re: Please help with regexp - finding all matches?"
- Reply: Jim Gibson: "Re: Please help with regexp - finding all matches?"
- Reply: Purl Gurl: "Re: Please help with regexp - finding all matches?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|
|