From 364a5a4083d66e566ca12af45eca68bbd7566498 Mon Sep 17 00:00:00 2001 From: Thomas Date: Sat, 15 Oct 2022 15:36:48 +0200 Subject: [PATCH 1/4] adjust charging point type parsing --- .../chargingpoint/ChargingPointTypeUtils.java | 3 +- .../ChargingPointTypeUtilsTest.groovy | 37 ++++++++++--------- 2 files changed, 21 insertions(+), 19 deletions(-) diff --git a/src/main/java/edu/ie3/datamodel/models/input/system/type/chargingpoint/ChargingPointTypeUtils.java b/src/main/java/edu/ie3/datamodel/models/input/system/type/chargingpoint/ChargingPointTypeUtils.java index e72de1aba..21446deb6 100644 --- a/src/main/java/edu/ie3/datamodel/models/input/system/type/chargingpoint/ChargingPointTypeUtils.java +++ b/src/main/java/edu/ie3/datamodel/models/input/system/type/chargingpoint/ChargingPointTypeUtils.java @@ -168,7 +168,8 @@ public static ChargingPointType parse(String parsableString) throws ChargingPoin ChargingPointType res; // valid regex for either custom or pre-defined types - String validCustomRegex = "(\\w+\\d*)\\s*\\(\\s*(\\d+\\.?\\d+)\\s*\\|\\s*(AC|DC)\\s*\\)"; + String validCustomRegex = + "([\\w \\-_]+)\\s*\\(\\s*(\\d+\\.?\\d+(?:E-?\\d+)?)\\s*\\|\\s*(AC|DC)\\s*\\)"; // does it match the valid regex? Pattern pattern = Pattern.compile(validCustomRegex); diff --git a/src/test/groovy/edu/ie3/datamodel/models/input/system/type/chargingpoint/ChargingPointTypeUtilsTest.groovy b/src/test/groovy/edu/ie3/datamodel/models/input/system/type/chargingpoint/ChargingPointTypeUtilsTest.groovy index 27f71d87e..7c6a6b22c 100644 --- a/src/test/groovy/edu/ie3/datamodel/models/input/system/type/chargingpoint/ChargingPointTypeUtilsTest.groovy +++ b/src/test/groovy/edu/ie3/datamodel/models/input/system/type/chargingpoint/ChargingPointTypeUtilsTest.groovy @@ -38,24 +38,25 @@ class ChargingPointTypeUtilsTest extends Specification { actual.toString() == expectedString where: - parsableString || expectedObj || expectedString - "household" || HouseholdSocket || "HouseholdSocket" - "HouseholdSocket" || HouseholdSocket || "HouseholdSocket" - "BlueHouseholdSocket" || BlueHouseholdSocket || "BlueHouseholdSocket" - "Cee16ASocket" || Cee16ASocket || "Cee16ASocket" - "cee32" || Cee32ASocket || "Cee32ASocket" - "CEE63" || Cee63ASocket || "Cee63ASocket" - "csT1" || ChargingStationType1 || "ChargingStationType1" - "stationtype2" || ChargingStationType2 || "ChargingStationType2" - "ChargingStationCcsComboType1" || ChargingStationCcsComboType1 || "ChargingStationCcsComboType1" - "csccs2" || ChargingStationCcsComboType2 || "ChargingStationCcsComboType2" - "TeslaSuperChargerV1" || TeslaSuperChargerV1 || "TeslaSuperChargerV1" - "tesla2" || TeslaSuperChargerV2 || "TeslaSuperChargerV2" - "supercharger3" || TeslaSuperChargerV3 || "TeslaSuperChargerV3" - "FastCharger(50|DC)" || new ChargingPointType("FastCharger", Quantities.getQuantity(50d, KILOVOLTAMPERE), ElectricCurrentType.DC) || "FastCharger(50.0|DC)" - "household(1.8|DC)" || new ChargingPointType("household", Quantities.getQuantity(1.8d, KILOVOLTAMPERE), ElectricCurrentType.DC) || "household(1.8|DC)" - "Household(2.3|AC)" || HouseholdSocket || "HouseholdSocket" - "household(2.3|AC)" || HouseholdSocket || "HouseholdSocket" + parsableString || expectedObj || expectedString + "household" || HouseholdSocket || "HouseholdSocket" + "HouseholdSocket" || HouseholdSocket || "HouseholdSocket" + "BlueHouseholdSocket" || BlueHouseholdSocket || "BlueHouseholdSocket" + "Cee16ASocket" || Cee16ASocket || "Cee16ASocket" + "cee32" || Cee32ASocket || "Cee32ASocket" + "CEE63" || Cee63ASocket || "Cee63ASocket" + "csT1" || ChargingStationType1 || "ChargingStationType1" + "stationtype2" || ChargingStationType2 || "ChargingStationType2" + "ChargingStationCcsComboType1" || ChargingStationCcsComboType1 || "ChargingStationCcsComboType1" + "csccs2" || ChargingStationCcsComboType2 || "ChargingStationCcsComboType2" + "TeslaSuperChargerV1" || TeslaSuperChargerV1 || "TeslaSuperChargerV1" + "tesla2" || TeslaSuperChargerV2 || "TeslaSuperChargerV2" + "supercharger3" || TeslaSuperChargerV3 || "TeslaSuperChargerV3" + "FastCharger(50|DC)" || new ChargingPointType("FastCharger", Quantities.getQuantity(50d, KILOVOLTAMPERE), ElectricCurrentType.DC) || "FastCharger(50.0|DC)" + "household(1.8|DC)" || new ChargingPointType("household", Quantities.getQuantity(1.8d, KILOVOLTAMPERE), ElectricCurrentType.DC) || "household(1.8|DC)" + "Household(2.3|AC)" || HouseholdSocket || "HouseholdSocket" + "household(2.3|AC)" || HouseholdSocket || "HouseholdSocket" + "Homecharger - 11kW(4.8E-4|AC)" || new ChargingPointType("Homecharger - 11kW", Quantities.getQuantity(4.8E-4d, KILOVOLTAMPERE), ElectricCurrentType.AC) || "Homecharger - 11kW(4.8E-4|AC)" } def "The ChargingPointTypeUtils should throw exceptions as expected when invalid charging point type strings are provided"() { From 53564dfac70d16878f2c98948193ba5c130f7bf1 Mon Sep 17 00:00:00 2001 From: Thomas Date: Sat, 15 Oct 2022 15:42:15 +0200 Subject: [PATCH 2/4] adjust changelog --- CHANGELOG.md | 1 + .../ChargingPointTypeUtilsTest.groovy | 94 +++++++++---------- 2 files changed, 48 insertions(+), 47 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 54f9cde2d..9fe26d458 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -45,6 +45,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Fixed spotlessApply handling for `.groovy` files [#637](https://github.com/ie3-institute/PowerSystemDataModel/issues/637) - Re-using SQL connection per default [#653](https://github.com/ie3-institute/PowerSystemDataModel/issues/653) - Persisting EmInputs [#665](https://github.com/ie3-institute/PowerSystemDataModel/issues/665) +- Charging point type parsing now works with more id definitions [#686](https://github.com/ie3-institute/PowerSystemDataModel/issues/685) ### Changed - BREAKING: PvInput Model parameter name height changed to elevationAngle [#393](https://github.com/ie3-institute/PowerSystemDataModel/issues/393) :warning: diff --git a/src/test/groovy/edu/ie3/datamodel/models/input/system/type/chargingpoint/ChargingPointTypeUtilsTest.groovy b/src/test/groovy/edu/ie3/datamodel/models/input/system/type/chargingpoint/ChargingPointTypeUtilsTest.groovy index 7c6a6b22c..8e4baf9a3 100644 --- a/src/test/groovy/edu/ie3/datamodel/models/input/system/type/chargingpoint/ChargingPointTypeUtilsTest.groovy +++ b/src/test/groovy/edu/ie3/datamodel/models/input/system/type/chargingpoint/ChargingPointTypeUtilsTest.groovy @@ -20,59 +20,59 @@ import static edu.ie3.util.quantities.PowerSystemUnits.KILOVOLTAMPERE */ class ChargingPointTypeUtilsTest extends Specification { - def "The ChargingPointTypeUtils should throw an exception on instantiation"() { - when: - new ChargingPointTypeUtils() + def "The ChargingPointTypeUtils should throw an exception on instantiation"() { + when: + new ChargingPointTypeUtils() - then: - IllegalStateException ex = thrown() - ex.message == "This is a factory class. Don't try to instantiate it." - } + then: + IllegalStateException ex = thrown() + ex.message == "This is a factory class. Don't try to instantiate it." + } - def "The ChargingPointTypeUtils should parse and return valid charging point type strings as expected"() { - given: - ChargingPointType actual = parse(parsableString) + def "The ChargingPointTypeUtils should parse and return valid charging point type strings as expected"() { + given: + ChargingPointType actual = parse(parsableString) - expect: - actual == expectedObj - actual.toString() == expectedString + expect: + actual == expectedObj + actual.toString() == expectedString - where: - parsableString || expectedObj || expectedString - "household" || HouseholdSocket || "HouseholdSocket" - "HouseholdSocket" || HouseholdSocket || "HouseholdSocket" - "BlueHouseholdSocket" || BlueHouseholdSocket || "BlueHouseholdSocket" - "Cee16ASocket" || Cee16ASocket || "Cee16ASocket" - "cee32" || Cee32ASocket || "Cee32ASocket" - "CEE63" || Cee63ASocket || "Cee63ASocket" - "csT1" || ChargingStationType1 || "ChargingStationType1" - "stationtype2" || ChargingStationType2 || "ChargingStationType2" - "ChargingStationCcsComboType1" || ChargingStationCcsComboType1 || "ChargingStationCcsComboType1" - "csccs2" || ChargingStationCcsComboType2 || "ChargingStationCcsComboType2" - "TeslaSuperChargerV1" || TeslaSuperChargerV1 || "TeslaSuperChargerV1" - "tesla2" || TeslaSuperChargerV2 || "TeslaSuperChargerV2" - "supercharger3" || TeslaSuperChargerV3 || "TeslaSuperChargerV3" - "FastCharger(50|DC)" || new ChargingPointType("FastCharger", Quantities.getQuantity(50d, KILOVOLTAMPERE), ElectricCurrentType.DC) || "FastCharger(50.0|DC)" - "household(1.8|DC)" || new ChargingPointType("household", Quantities.getQuantity(1.8d, KILOVOLTAMPERE), ElectricCurrentType.DC) || "household(1.8|DC)" - "Household(2.3|AC)" || HouseholdSocket || "HouseholdSocket" - "household(2.3|AC)" || HouseholdSocket || "HouseholdSocket" - "Homecharger - 11kW(4.8E-4|AC)" || new ChargingPointType("Homecharger - 11kW", Quantities.getQuantity(4.8E-4d, KILOVOLTAMPERE), ElectricCurrentType.AC) || "Homecharger - 11kW(4.8E-4|AC)" - } + where: + parsableString || expectedObj || expectedString + "household" || HouseholdSocket || "HouseholdSocket" + "HouseholdSocket" || HouseholdSocket || "HouseholdSocket" + "BlueHouseholdSocket" || BlueHouseholdSocket || "BlueHouseholdSocket" + "Cee16ASocket" || Cee16ASocket || "Cee16ASocket" + "cee32" || Cee32ASocket || "Cee32ASocket" + "CEE63" || Cee63ASocket || "Cee63ASocket" + "csT1" || ChargingStationType1 || "ChargingStationType1" + "stationtype2" || ChargingStationType2 || "ChargingStationType2" + "ChargingStationCcsComboType1" || ChargingStationCcsComboType1 || "ChargingStationCcsComboType1" + "csccs2" || ChargingStationCcsComboType2 || "ChargingStationCcsComboType2" + "TeslaSuperChargerV1" || TeslaSuperChargerV1 || "TeslaSuperChargerV1" + "tesla2" || TeslaSuperChargerV2 || "TeslaSuperChargerV2" + "supercharger3" || TeslaSuperChargerV3 || "TeslaSuperChargerV3" + "FastCharger(50|DC)" || new ChargingPointType("FastCharger", Quantities.getQuantity(50d, KILOVOLTAMPERE), ElectricCurrentType.DC) || "FastCharger(50.0|DC)" + "household(1.8|DC)" || new ChargingPointType("household", Quantities.getQuantity(1.8d, KILOVOLTAMPERE), ElectricCurrentType.DC) || "household(1.8|DC)" + "Household(2.3|AC)" || HouseholdSocket || "HouseholdSocket" + "household(2.3|AC)" || HouseholdSocket || "HouseholdSocket" + "Homecharger - 11kW(4.8E-4|AC)" || new ChargingPointType("Homecharger - 11kW", Quantities.getQuantity(4.8E-4d, KILOVOLTAMPERE), ElectricCurrentType.AC) || "Homecharger - 11kW(4.8E-4|AC)" + } - def "The ChargingPointTypeUtils should throw exceptions as expected when invalid charging point type strings are provided"() { - when: - parse(invalidString) + def "The ChargingPointTypeUtils should throw exceptions as expected when invalid charging point type strings are provided"() { + when: + parse(invalidString) - then: - ChargingPointTypeException ex = thrown() - ex.message == expectedExceptionMsg + then: + ChargingPointTypeException ex = thrown() + ex.message == expectedExceptionMsg - where: + where: - invalidString || expectedExceptionMsg - "" || "Provided charging point type string '' is neither a valid custom type string nor can a common charging point type with id '' be found! Please either provide a valid custom string in the format '(|)' (e.g. 'FastCharger(50|DC)') or a common type id (see docs for all available common types)." - "DCFast" || "Provided charging point type string 'DCFast' is neither a valid custom type string nor can a common charging point type with id 'DCFast' be found! Please either provide a valid custom string in the format '(|)' (e.g. 'FastCharger(50|DC)') or a common type id (see docs for all available common types)." - "FastCharger(50|PC)" || "Provided charging point type string 'FastCharger(50|PC)' is neither a valid custom type string nor can a common charging point type with id 'FastCharger(50|PC)' be found! Please either provide a valid custom string in the format '(|)' (e.g. 'FastCharger(50|DC)') or a common type id (see docs for all available common types)." - "FastCharger(AC|2.4)" || "Provided charging point type string 'FastCharger(AC|2.4)' is neither a valid custom type string nor can a common charging point type with id 'FastCharger(AC|2.4)' be found! Please either provide a valid custom string in the format '(|)' (e.g. 'FastCharger(50|DC)') or a common type id (see docs for all available common types)." - } + invalidString || expectedExceptionMsg + "" || "Provided charging point type string '' is neither a valid custom type string nor can a common charging point type with id '' be found! Please either provide a valid custom string in the format '(|)' (e.g. 'FastCharger(50|DC)') or a common type id (see docs for all available common types)." + "DCFast" || "Provided charging point type string 'DCFast' is neither a valid custom type string nor can a common charging point type with id 'DCFast' be found! Please either provide a valid custom string in the format '(|)' (e.g. 'FastCharger(50|DC)') or a common type id (see docs for all available common types)." + "FastCharger(50|PC)" || "Provided charging point type string 'FastCharger(50|PC)' is neither a valid custom type string nor can a common charging point type with id 'FastCharger(50|PC)' be found! Please either provide a valid custom string in the format '(|)' (e.g. 'FastCharger(50|DC)') or a common type id (see docs for all available common types)." + "FastCharger(AC|2.4)" || "Provided charging point type string 'FastCharger(AC|2.4)' is neither a valid custom type string nor can a common charging point type with id 'FastCharger(AC|2.4)' be found! Please either provide a valid custom string in the format '(|)' (e.g. 'FastCharger(50|DC)') or a common type id (see docs for all available common types)." + } } From dee7a2efd2f9136c92646c7ca553dd4e353970d0 Mon Sep 17 00:00:00 2001 From: Thomas Date: Sat, 15 Oct 2022 15:45:06 +0200 Subject: [PATCH 3/4] fmt --- .../ChargingPointTypeUtilsTest.groovy | 94 +++++++++---------- 1 file changed, 47 insertions(+), 47 deletions(-) diff --git a/src/test/groovy/edu/ie3/datamodel/models/input/system/type/chargingpoint/ChargingPointTypeUtilsTest.groovy b/src/test/groovy/edu/ie3/datamodel/models/input/system/type/chargingpoint/ChargingPointTypeUtilsTest.groovy index 8e4baf9a3..16339003e 100644 --- a/src/test/groovy/edu/ie3/datamodel/models/input/system/type/chargingpoint/ChargingPointTypeUtilsTest.groovy +++ b/src/test/groovy/edu/ie3/datamodel/models/input/system/type/chargingpoint/ChargingPointTypeUtilsTest.groovy @@ -20,59 +20,59 @@ import static edu.ie3.util.quantities.PowerSystemUnits.KILOVOLTAMPERE */ class ChargingPointTypeUtilsTest extends Specification { - def "The ChargingPointTypeUtils should throw an exception on instantiation"() { - when: - new ChargingPointTypeUtils() + def "The ChargingPointTypeUtils should throw an exception on instantiation"() { + when: + new ChargingPointTypeUtils() - then: - IllegalStateException ex = thrown() - ex.message == "This is a factory class. Don't try to instantiate it." - } + then: + IllegalStateException ex = thrown() + ex.message == "This is a factory class. Don't try to instantiate it." + } - def "The ChargingPointTypeUtils should parse and return valid charging point type strings as expected"() { - given: - ChargingPointType actual = parse(parsableString) + def "The ChargingPointTypeUtils should parse and return valid charging point type strings as expected"() { + given: + ChargingPointType actual = parse(parsableString) - expect: - actual == expectedObj - actual.toString() == expectedString + expect: + actual == expectedObj + actual.toString() == expectedString - where: - parsableString || expectedObj || expectedString - "household" || HouseholdSocket || "HouseholdSocket" - "HouseholdSocket" || HouseholdSocket || "HouseholdSocket" - "BlueHouseholdSocket" || BlueHouseholdSocket || "BlueHouseholdSocket" - "Cee16ASocket" || Cee16ASocket || "Cee16ASocket" - "cee32" || Cee32ASocket || "Cee32ASocket" - "CEE63" || Cee63ASocket || "Cee63ASocket" - "csT1" || ChargingStationType1 || "ChargingStationType1" - "stationtype2" || ChargingStationType2 || "ChargingStationType2" - "ChargingStationCcsComboType1" || ChargingStationCcsComboType1 || "ChargingStationCcsComboType1" - "csccs2" || ChargingStationCcsComboType2 || "ChargingStationCcsComboType2" - "TeslaSuperChargerV1" || TeslaSuperChargerV1 || "TeslaSuperChargerV1" - "tesla2" || TeslaSuperChargerV2 || "TeslaSuperChargerV2" - "supercharger3" || TeslaSuperChargerV3 || "TeslaSuperChargerV3" - "FastCharger(50|DC)" || new ChargingPointType("FastCharger", Quantities.getQuantity(50d, KILOVOLTAMPERE), ElectricCurrentType.DC) || "FastCharger(50.0|DC)" - "household(1.8|DC)" || new ChargingPointType("household", Quantities.getQuantity(1.8d, KILOVOLTAMPERE), ElectricCurrentType.DC) || "household(1.8|DC)" - "Household(2.3|AC)" || HouseholdSocket || "HouseholdSocket" - "household(2.3|AC)" || HouseholdSocket || "HouseholdSocket" - "Homecharger - 11kW(4.8E-4|AC)" || new ChargingPointType("Homecharger - 11kW", Quantities.getQuantity(4.8E-4d, KILOVOLTAMPERE), ElectricCurrentType.AC) || "Homecharger - 11kW(4.8E-4|AC)" - } + where: + parsableString || expectedObj || expectedString + "household" || HouseholdSocket || "HouseholdSocket" + "HouseholdSocket" || HouseholdSocket || "HouseholdSocket" + "BlueHouseholdSocket" || BlueHouseholdSocket || "BlueHouseholdSocket" + "Cee16ASocket" || Cee16ASocket || "Cee16ASocket" + "cee32" || Cee32ASocket || "Cee32ASocket" + "CEE63" || Cee63ASocket || "Cee63ASocket" + "csT1" || ChargingStationType1 || "ChargingStationType1" + "stationtype2" || ChargingStationType2 || "ChargingStationType2" + "ChargingStationCcsComboType1" || ChargingStationCcsComboType1 || "ChargingStationCcsComboType1" + "csccs2" || ChargingStationCcsComboType2 || "ChargingStationCcsComboType2" + "TeslaSuperChargerV1" || TeslaSuperChargerV1 || "TeslaSuperChargerV1" + "tesla2" || TeslaSuperChargerV2 || "TeslaSuperChargerV2" + "supercharger3" || TeslaSuperChargerV3 || "TeslaSuperChargerV3" + "FastCharger(50|DC)" || new ChargingPointType("FastCharger", Quantities.getQuantity(50d, KILOVOLTAMPERE), ElectricCurrentType.DC) || "FastCharger(50.0|DC)" + "household(1.8|DC)" || new ChargingPointType("household", Quantities.getQuantity(1.8d, KILOVOLTAMPERE), ElectricCurrentType.DC) || "household(1.8|DC)" + "Household(2.3|AC)" || HouseholdSocket || "HouseholdSocket" + "household(2.3|AC)" || HouseholdSocket || "HouseholdSocket" + "Homecharger - 11kW(4.8E-4|AC)" || new ChargingPointType("Homecharger - 11kW", Quantities.getQuantity(4.8E-4d, KILOVOLTAMPERE), ElectricCurrentType.AC) || "Homecharger - 11kW(4.8E-4|AC)" + } - def "The ChargingPointTypeUtils should throw exceptions as expected when invalid charging point type strings are provided"() { - when: - parse(invalidString) + def "The ChargingPointTypeUtils should throw exceptions as expected when invalid charging point type strings are provided"() { + when: + parse(invalidString) - then: - ChargingPointTypeException ex = thrown() - ex.message == expectedExceptionMsg + then: + ChargingPointTypeException ex = thrown() + ex.message == expectedExceptionMsg - where: + where: - invalidString || expectedExceptionMsg - "" || "Provided charging point type string '' is neither a valid custom type string nor can a common charging point type with id '' be found! Please either provide a valid custom string in the format '(|)' (e.g. 'FastCharger(50|DC)') or a common type id (see docs for all available common types)." - "DCFast" || "Provided charging point type string 'DCFast' is neither a valid custom type string nor can a common charging point type with id 'DCFast' be found! Please either provide a valid custom string in the format '(|)' (e.g. 'FastCharger(50|DC)') or a common type id (see docs for all available common types)." - "FastCharger(50|PC)" || "Provided charging point type string 'FastCharger(50|PC)' is neither a valid custom type string nor can a common charging point type with id 'FastCharger(50|PC)' be found! Please either provide a valid custom string in the format '(|)' (e.g. 'FastCharger(50|DC)') or a common type id (see docs for all available common types)." - "FastCharger(AC|2.4)" || "Provided charging point type string 'FastCharger(AC|2.4)' is neither a valid custom type string nor can a common charging point type with id 'FastCharger(AC|2.4)' be found! Please either provide a valid custom string in the format '(|)' (e.g. 'FastCharger(50|DC)') or a common type id (see docs for all available common types)." - } + invalidString || expectedExceptionMsg + "" || "Provided charging point type string '' is neither a valid custom type string nor can a common charging point type with id '' be found! Please either provide a valid custom string in the format '(|)' (e.g. 'FastCharger(50|DC)') or a common type id (see docs for all available common types)." + "DCFast" || "Provided charging point type string 'DCFast' is neither a valid custom type string nor can a common charging point type with id 'DCFast' be found! Please either provide a valid custom string in the format '(|)' (e.g. 'FastCharger(50|DC)') or a common type id (see docs for all available common types)." + "FastCharger(50|PC)" || "Provided charging point type string 'FastCharger(50|PC)' is neither a valid custom type string nor can a common charging point type with id 'FastCharger(50|PC)' be found! Please either provide a valid custom string in the format '(|)' (e.g. 'FastCharger(50|DC)') or a common type id (see docs for all available common types)." + "FastCharger(AC|2.4)" || "Provided charging point type string 'FastCharger(AC|2.4)' is neither a valid custom type string nor can a common charging point type with id 'FastCharger(AC|2.4)' be found! Please either provide a valid custom string in the format '(|)' (e.g. 'FastCharger(50|DC)') or a common type id (see docs for all available common types)." + } } From be0a8fcbeb140e0b69d36a8fb68ee38c5cf0ebae Mon Sep 17 00:00:00 2001 From: Thomas Date: Sat, 15 Oct 2022 15:50:13 +0200 Subject: [PATCH 4/4] fix regex code smell --- .../input/system/type/chargingpoint/ChargingPointTypeUtils.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/edu/ie3/datamodel/models/input/system/type/chargingpoint/ChargingPointTypeUtils.java b/src/main/java/edu/ie3/datamodel/models/input/system/type/chargingpoint/ChargingPointTypeUtils.java index 21446deb6..0a357ff50 100644 --- a/src/main/java/edu/ie3/datamodel/models/input/system/type/chargingpoint/ChargingPointTypeUtils.java +++ b/src/main/java/edu/ie3/datamodel/models/input/system/type/chargingpoint/ChargingPointTypeUtils.java @@ -169,7 +169,7 @@ public static ChargingPointType parse(String parsableString) throws ChargingPoin // valid regex for either custom or pre-defined types String validCustomRegex = - "([\\w \\-_]+)\\s*\\(\\s*(\\d+\\.?\\d+(?:E-?\\d+)?)\\s*\\|\\s*(AC|DC)\\s*\\)"; + "([\\w \\-]+)\\s*\\(\\s*(\\d+\\.?\\d+(?:E-?\\d+)?)\\s*\\|\\s*(AC|DC)\\s*\\)"; // does it match the valid regex? Pattern pattern = Pattern.compile(validCustomRegex);