I have summary text data from pubmed and I want to separate them into author, title, author, date and pubid etc using PHP
1) to spit each article
$choppeddata = preg_split('/([\r\n])(?=\d+: )/',$data);
2) preg_match($pmregex, trim($subdata), $matches);
match pattern:
//Journal list number and authorlist
$pmregex = '/^(\d+): (.+?)\.'
//article title
. ' (.+?)\.'
// (.+?) Journal name such as Oral Dis
// \. (\d\d\d\d)(.*?); . 2013 Jul
// ;(.+?) :19 (5)
//:(\w+)-?(\w*?) page number such as 440-451
. '(.+?)[\. \n?](\d\d\d\d)(.*?);(.+?):(\w+)-?(\w*?)[\.\;](.*)'
//PMID number
. '[PMID: \n?](\d+)'
. '/s';
More about code:
http://jiansenlu.blogspot.com/2013/10...