Deduplicate header regex normalization
Change-Id: I6439a5c57071d651b1a4b02c304122eef4bef541
diff --git a/script/tei2korapxml b/script/tei2korapxml
index bfc142a..60a7ceb 100755
--- a/script/tei2korapxml
+++ b/script/tei2korapxml
@@ -192,9 +192,12 @@
$_root_dir .= '/'; # base dir must always end with a slash
$_root_dir =~ s/^\.?\///; # remove leading / (only relative paths allowed in IO::Compress::Zip) and redundant ./
-$_CORP_HEADER_BEG =~ s#^([^\s]+)(.*)$#$1\[\^>\]*$2#;
-$_DOC_HEADER_BEG =~ s#^([^\s]+)(.*)$#$1\[\^>\]*$2#;
-$_TEXT_HEADER_BEG =~ s#^([^\s]+)(.*)$#$1\[\^>\]*$2#;
+# Normalize regex for header parsing
+for ($_CORP_HEADER_BEG,
+ $_DOC_HEADER_BEG,
+ $_TEXT_HEADER_BEG) {
+ s!^([^\s]+)(.*)$!$1\[\^>\]*$2!;
+};
$data_prfx1 = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n";
$data_prfx1 .= "<?xml-model href=\"text.rng\" type=\"application/xml\" schematypens=\"http://relaxng.org/ns/structure/1.0\"?>\n\n";