You are here

function PARSEENTRIES::fieldSplit in Bibliography Module 6

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

File

bibtexParse/PARSEENTRIES.php, line 236

Class

PARSEENTRIES

Code

function fieldSplit($seg) {

  // echo "**** ";print_r($seg);echo "<BR>";
  // handle fields like another-field = {}
  $array = preg_split("/,\\s*([-_.:,a-zA-Z0-9]+)\\s*={1}\\s*/U", $seg, PREG_SPLIT_DELIM_CAPTURE);

  // echo "**** ";print_r($array);echo "<BR>";

  //$array = preg_split("/,\s*(\w+)\s*={1}\s*/U", $seg, PREG_SPLIT_DELIM_CAPTURE);
  if (!array_key_exists(1, $array)) {
    return array(
      $array[0],
      FALSE,
    );
  }
  return array(
    $array[0],
    $array[1],
  );
}