diff --git a/core/src/net/sf/openrocket/formatting/MotorConfigurationSubstitutor.java b/core/src/net/sf/openrocket/formatting/MotorConfigurationSubstitutor.java
index 71f1ae751..7b152be7a 100644
--- a/core/src/net/sf/openrocket/formatting/MotorConfigurationSubstitutor.java
+++ b/core/src/net/sf/openrocket/formatting/MotorConfigurationSubstitutor.java
@@ -26,8 +26,9 @@ import java.util.regex.Pattern;
* General substitutor for motor configurations. This currently includes substitutions for
* - {motors} - the motor designation (e.g. "M1350-0")
* - {manufacturers} - the motor manufacturer (e.g. "AeroTech")
- * - a combination of motors and manufacturers, e.g. {motors manufacturers} -> "M1350-0 AeroTech"
- * You can choose which comes first is. E.g. {manufacturers motors} -> "AeroTech M1350-0".
+ * - {cases} - the motor case (e.g. "SU 18.0x70.0")
+ * - a combination of motors and manufacturers, e.g. {motors | manufacturers} -> "M1350-0 | AeroTech"
+ * You can choose which comes first and what the separator is. E.g. {manufacturers, motors} -> "AeroTech, M1350-0".
*
*
* This substitutor is added through injection. All substitutors with the "@Plugin" tag in the formatting package will
@@ -75,10 +76,27 @@ public class MotorConfigurationSubstitutor implements RocketSubstitutor {
while (matcher.find()) {
String tagContent = matcher.group(1).trim();
- String[] keys = tagContent.split("\\s");
+ // Step 1: Find the keys
+ List foundKeys = new ArrayList<>();
+ Matcher keyMatcher = Pattern.compile("\\b(" + String.join("|", SUBSTITUTIONS.keySet()) + ")\\b").matcher(tagContent);
+ while (keyMatcher.find()) {
+ foundKeys.add(keyMatcher.group());
+ }
+
+ // Step 2: Extracting the separators
+ List separators = new ArrayList<>();
+ int lastEnd = 0;
+ for (int i = 0; i < foundKeys.size() - 1; i++) {
+ int startOfNextKey = tagContent.indexOf(foundKeys.get(i + 1), lastEnd);
+ String separator = tagContent.substring(lastEnd + foundKeys.get(i).length(), startOfNextKey);
+ separators.add(separator);
+ lastEnd = startOfNextKey + foundKeys.get(i + 1).length();
+ }
+
+ // Continue with the original function
List