I have a string like this:
Name: John Doe
Age: 23
Primary Language: English
Description: This is a multiline
description field that I want
to capture
Country: Canada
That's not the actual data, but you can see what I'm trying to do. I want to use regex to get an array of the "key" fields (Name, Age, Primary Language, Description, Country) and their values.
I'm using PHP.
My current attempt is this, but it doesn't work:
preg_match( '/^(.*?\:) (.*?)(\n.*?\:)/ism', $text, $matches );
$_POSTor out of a database?