# Suppress leading repeated number string in two numbers that are separated # by a double-dash. # Usage: # sed -f bbl.sed < inp.bbl > out.bbl # Examples: # 834--837 in stdin is replaced by 834--7 on output. "83" is suppressed. # 834--847 in stdin is replaced by 834--47 on output. "8" is suppressed # 834-837 in stdin is not changed (because only a single dash is found) # 834--937 in stdin is not changed because there is no common starting string. # # Richard J. Mathar, http://www.strw.leidenuniv.nl # 2006-12-15 s/\([^0-9][-0-9]*\)\(.\)--\1\(.\)/\1\2--\3/g s/\([^0-9][-0-9]*\)\(..\)--\1\(..\)/\1\2--\3/g s/\([^0-9][-0-9]*\)\(...\)--\1\(...\)/\1\2--\3/g s/\([^0-9][-0-9]*\)\(....\)--\1\(....\)/\1\2--\3/g s/\([^0-9][-0-9]*\)\(.....\)--\1\(.....\)/\1\2--\3/g