diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/sisu/v5/ao_numbering.rb | 4 | ||||
-rw-r--r-- | lib/sisu/v6/ao_numbering.rb | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/lib/sisu/v5/ao_numbering.rb b/lib/sisu/v5/ao_numbering.rb index 278ea514..d213ca4d 100644 --- a/lib/sisu/v5/ao_numbering.rb +++ b/lib/sisu/v5/ao_numbering.rb @@ -326,7 +326,7 @@ module SiSU_AO_Numbering if possible_seg_name =~/^[0-9]+$/m \ and possible_seg_name.to_i <= heading_num_is.to_i prefix + leading_zeros_fixed_width_number(possible_seg_name) - elsif possible_seg_name =~/^[\d.,:-]+$/m + elsif possible_seg_name =~/^[0-9][\d.,:-]*$/m possible_seg_name=possible_seg_name. gsub(/(?:[:,-]|\W)/,'.'). gsub(/\.$/,'') @@ -369,7 +369,7 @@ module SiSU_AO_Numbering @md.set_heading_seg=true end if dob.name !~/^\S+/ \ - and dob.obj =~/^\s*(?:\S+\s+)?([\d.,:-]+)/m #heading starts with a recognised numeric or word followed by a recognised numeric construct, use that as name + and dob.obj =~/^\s*(?:\S+\s+)?([0-9][0-9.,:-]*)/m #heading starts with a recognised numeric or word followed by a recognised numeric construct, use that as name possible_seg_name=$1 possible_seg_name= auto_seg_name(possible_seg_name,heading_num_is,:extract) diff --git a/lib/sisu/v6/ao_numbering.rb b/lib/sisu/v6/ao_numbering.rb index ffafbf9c..ef85bbd6 100644 --- a/lib/sisu/v6/ao_numbering.rb +++ b/lib/sisu/v6/ao_numbering.rb @@ -326,7 +326,7 @@ module SiSU_AO_Numbering if possible_seg_name =~/^[0-9]+$/m \ and possible_seg_name.to_i <= heading_num_is.to_i prefix + leading_zeros_fixed_width_number(possible_seg_name) - elsif possible_seg_name =~/^[\d.,:-]+$/m + elsif possible_seg_name =~/^[0-9][\d.,:-]*$/m possible_seg_name=possible_seg_name. gsub(/(?:[:,-]|\W)/,'.'). gsub(/\.$/,'') @@ -369,7 +369,7 @@ module SiSU_AO_Numbering @md.set_heading_seg=true end if dob.name !~/^\S+/ \ - and dob.obj =~/^\s*(?:\S+\s+)?([\d.,:-]+)/m #heading starts with a recognised numeric or word followed by a recognised numeric construct, use that as name + and dob.obj =~/^\s*(?:\S+\s+)?([0-9][0-9.,:-]*)/m #heading starts with a recognised numeric or word followed by a recognised numeric construct, use that as name possible_seg_name=$1 possible_seg_name= auto_seg_name(possible_seg_name,heading_num_is,:extract) |