Commit 142fe277 authored by David Maus's avatar David Maus
Browse files

Allow multiple whitespace characters after field tag

* src/HAB/Pica/Parser/PicaPlainParser.php (parseField): Allow multiple
  whitespace characters after field tag.
parent 338c74a8
......@@ -6,7 +6,7 @@
PicaReader provides classes for reading Pica+ records encoded in PicaXML and PicaPlain.
PicaReader is copyright (c) 2012-2016 by Herzog August Bibliothek Wolfenbüttel and released under the
PicaReader is copyright (c) 2012-2017 by Herzog August Bibliothek Wolfenbüttel and released under the
terms of the GNU General Public License v3.
* Installation
......
......@@ -20,7 +20,7 @@
*
* @package PicaReader
* @author David Maus <maus@hab.de>
* @copyright Copyright (c) 2012 - 2016 by Herzog August Bibliothek Wolfenbüttel
* @copyright Copyright (c) 2012 - 2017 by Herzog August Bibliothek Wolfenbüttel
* @license http://www.gnu.org/licenses/gpl.html GNU General Public License v3
*/
......@@ -38,7 +38,7 @@ class PicaPlainParser implements PicaPlainParserInterface
{
$field = array('subfields' => array());
$match = array();
if (preg_match('#^([012][0-9]{2}[A-Z@])(/([0-9]{2}))? (\$.*)$#Du', $line, $match)) {
if (preg_match('#^([012][0-9]{2}[A-Z@])(/([0-9]{2}))?\s+(\$.*)$#Du', $line, $match)) {
$field = array('tag' => $match[1],
'occurrence' => $match[3] ?: null,
'subfields' => $this->parseSubfields($match[4]));;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment