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 @@ ...@@ -6,7 +6,7 @@
PicaReader provides classes for reading Pica+ records encoded in PicaXML and PicaPlain. 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. terms of the GNU General Public License v3.
* Installation * Installation
......
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
* *
* @package PicaReader * @package PicaReader
* @author David Maus <maus@hab.de> * @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 * @license http://www.gnu.org/licenses/gpl.html GNU General Public License v3
*/ */
...@@ -38,7 +38,7 @@ class PicaPlainParser implements PicaPlainParserInterface ...@@ -38,7 +38,7 @@ class PicaPlainParser implements PicaPlainParserInterface
{ {
$field = array('subfields' => array()); $field = array('subfields' => array());
$match = 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], $field = array('tag' => $match[1],
'occurrence' => $match[3] ?: null, 'occurrence' => $match[3] ?: null,
'subfields' => $this->parseSubfields($match[4]));; 'subfields' => $this->parseSubfields($match[4]));;
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
001U $0utf8 001U $0utf8
001X $00 001X $00
002@ $0Aau 002@ $0Aau
003@ $0024836885 003@ $0024836885
003O $aOCoLC$019095997$v2009-06-15 003O $aOCoLC$019095997$v2009-06-15
004A $03787307699$fDM 26.- 004A $03787307699$fDM 26.-
004A $03787307702$fDM 68.- 004A $03787307702$fDM 68.-
......
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