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

Mason James szrj1m at yahoo.com
Thu Jan 31 00:37:33 CET 2008


CVSROOT:	/sources/koha
Module name:	koha
Branch:		dev_week
Changes by:	Mason James <sushi>	08/01/30 23:37:33

Modified files:
	C4             : Labels.pm 

Log message:
	split_lccn() better regex again.

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

Patches:
Index: Labels.pm
===================================================================
RCS file: /sources/koha/koha/C4/Labels.pm,v
retrieving revision 1.3.4.58
retrieving revision 1.3.4.59
diff -u -b -r1.3.4.58 -r1.3.4.59
--- Labels.pm	29 Jan 2008 20:58:09 -0000	1.3.4.58
+++ Labels.pm	30 Jan 2008 23:37:33 -0000	1.3.4.59
@@ -27,7 +27,7 @@
 use Algorithm::CheckDigits;
 
 # use Data::Dumper;
-# use Smart::Comments '###';
+# use Smart::Comments '#####';
 
 $VERSION = 0.01;
 
@@ -113,17 +113,21 @@
 sub split_lccn {
     my ($lccn) = @_;    
     my ( $ll, $wnl, $dec, $cutter, $pubdate);
+
     $_ = $lccn;
 
 # lccn example 'HE8700.7 .P6T44 1983';
     my    @splits   = m/
-        ([a-zA-Z]+)      
-        ([0-9]+\.*[0-9]+\s*)    # 8700.7 or 8700 without '.', 
-                                # handles trailing space too
-        (\.[a-zA-Z0-9]+\s*)        #.P6T44
-        ([0-9]+)                # 1983
+        (^[a-zA-Z]+)            # HE
+        ([0-9]+\.*[0-9]*)             # 8700.7
+        \s*
+        (\.*[a-zA-Z0-9]*)       # P6T44
+        \s*
+        ([0-9]*)                # 1983
         /x;
 
+##### @splits
+
 # strip something occuring spaces too
 $splits[0] =~ s/\s+$//;
 $splits[1] =~ s/\s+$//;





More information about the Koha-cvs mailing list