[Koha-cvs] koha/C4 Labels.pm [dev_week]

Mason James szrj1m at yahoo.com
Mon Oct 22 01:03:38 CEST 2007


CVSROOT:	/sources/koha
Module name:	koha
Branch:		dev_week
Changes by:	Mason James <sushi>	07/10/21 23:03:38

Modified files:
	C4             : Labels.pm 

Log message:
	handles occassional spaces too

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/koha/C4/Labels.pm?cvsroot=koha&only_with_tag=dev_week&r1=1.3.4.51&r2=1.3.4.52

Patches:
Index: Labels.pm
===================================================================
RCS file: /sources/koha/koha/C4/Labels.pm,v
retrieving revision 1.3.4.51
retrieving revision 1.3.4.52
diff -u -b -r1.3.4.51 -r1.3.4.52
--- Labels.pm	21 Oct 2007 22:46:49 -0000	1.3.4.51
+++ Labels.pm	21 Oct 2007 23:03:38 -0000	1.3.4.52
@@ -114,15 +114,16 @@
     my ($lccn) = @_;    
     my ( $ll, $wnl, $dec, $cutter, $pubdate);
 
-    $lccn = 'HE8700.7 .P6T44 1983';
     $_ = $lccn;
 
-    my @splits   = m/([a-zA-Z]+)
-        ([0-9]+\.[0-9]+)
-        (\s)
-        (\.[a-zA-Z0-9]+)
-        (\s)
-        ([0-9]+)
+# lccn example 'HE8700.7 .P6T44 1983';
+    my @splits   = m/
+        ([a-zA-Z]+)             # HE
+        ([0-9]+\.*[0-9]+\s*)    # 8700.7 or 8700 without '.', 
+                                # handles trailing space too
+        (\.[a-zA-Z0-9]+)        #.P6T44
+        (\s)                    # space
+        ([0-9]+)                # 1983
         /x;
 
     splice (@splits, 2,1); 





More information about the Koha-cvs mailing list