You are here

public function PARSEENTRIES::fullSplit in Bibliography Module 7

Same name and namespace in other branches
  1. 5 bibtexParse/PARSEENTRIES.php \PARSEENTRIES::fullSplit()
  2. 6.2 modules/bibtexParse/PARSEENTRIES.php \PARSEENTRIES::fullSplit()
  3. 6 bibtexParse/PARSEENTRIES.php \PARSEENTRIES::fullSplit()
  4. 7.3 plugins/biblio_style/bibtex/PARSEENTRIES.php \PARSEENTRIES::fullSplit()
  5. 7.2 modules/bibtexParse/PARSEENTRIES.php \PARSEENTRIES::fullSplit()

Start splitting a bibtex entry into component fields. Store the entry type and citation.

1 call to PARSEENTRIES::fullSplit()
PARSEENTRIES::parseEntry in modules/bibtexParse/PARSEENTRIES.php
Grab a complete bibtex entry.

File

modules/bibtexParse/PARSEENTRIES.php, line 333

Class

PARSEENTRIES
// Parse a file $parse = NEW PARSEENTRIES(); $parse->expandMacro = TRUE; // $array = array("RMP" =>"Rev., Mod. Phys."); // $parse->loadStringMacro($array); // $parse->removeDelimit = FALSE; // …

Code

public function fullSplit($entry) {
  $matches = preg_split("/@(.*)[{(](.*),/U", $entry, 2, PREG_SPLIT_DELIM_CAPTURE);
  $this->entries[$this->count]['bibtexEntryType'] = strtolower(trim($matches[1]));

  // Sometimes a bibtex entry will have no citation key
  // this is a field.
  if (preg_match("/=/", $matches[2])) {
    $matches = preg_split("/@(.*)\\s*[{(](.*)/U", $entry, 2, PREG_SPLIT_DELIM_CAPTURE);
  }

  // print_r($matches); print "<P>";.
  $this->entries[$this->count]['bibtexCitation'] = $matches[2];
  $this
    ->reduceFields($matches[3]);
}