0

I want to parse this expression

PFolder=Personal Folders&SFolder=Inbox&Message=3

and want to extract Personal Folders from PFolder,Inbox from SFolder and 3 from Message,so that i can further use this things "Personal Folders,Inbox and 3"in the program.

How can I do it?

3
Contributors
3
Replies
4
Views
10 Years
Discussion Span
Last Post by bhavna_816
0

Hi!

$s = "PFolder=PersonalFolder&SFolder=Inbox&Message=3";
@matches = ();

push @matches, $1 while $s =~ /=(.+?)(&|$)/g;

print join(", ", @matches);

Hope this helps.

Regards, mawe

0

that really looks like query string data, in which case the CGI module could be used to get you name value pairs into your script for further use.

0

Thanks mawe and Kevin!
U have helped me a lot!
Thanks and Regards,
Bhavna

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.