You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@plc4x.apache.org by sr...@apache.org on 2018/06/21 08:45:59 UTC
[incubator-plc4x] 02/03: fixed serial driver regex to match the
serial port the right way
This is an automated email from the ASF dual-hosted git repository.
sruehl pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-plc4x.git
commit 151a20ffbcf00082b2336f97cbbb1881425cdbc7
Author: Sebastian Rühl <sr...@apache.org>
AuthorDate: Thu Jun 21 10:34:49 2018 +0200
fixed serial driver regex to match the serial port the right way
---
.../ads/src/main/java/org/apache/plc4x/java/ads/AdsPlcDriver.java | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/plc4j/protocols/ads/src/main/java/org/apache/plc4x/java/ads/AdsPlcDriver.java b/plc4j/protocols/ads/src/main/java/org/apache/plc4x/java/ads/AdsPlcDriver.java
index 2e6b3bf..2a208ad 100644
--- a/plc4j/protocols/ads/src/main/java/org/apache/plc4x/java/ads/AdsPlcDriver.java
+++ b/plc4j/protocols/ads/src/main/java/org/apache/plc4x/java/ads/AdsPlcDriver.java
@@ -46,7 +46,7 @@ public class AdsPlcDriver implements PlcDriver {
+ "(?<sourceAmsNetId>" + AmsNetId.AMS_NET_ID_PATTERN + "):(?<sourceAmsPort>" + AmsPort.AMS_PORT_PATTERN + ")"
+ ")?");
public static final Pattern INET_ADDRESS_PATTERN = Pattern.compile("tcp://(?<host>[\\w.]+)(:(?<port>\\d*))?");
- public static final Pattern SERIAL_PATTERN = Pattern.compile("serial://(?<serialDefinition>.*)");
+ public static final Pattern SERIAL_PATTERN = Pattern.compile("serial://(?<serialDefinition>((?!/\\d).)*)");
public static final Pattern ADS_URI_PATTERN = Pattern.compile("^ads:(" + INET_ADDRESS_PATTERN + "|" + SERIAL_PATTERN + ")/" + ADS_ADDRESS_PATTERN + "(\\?.*)?");
private AdsConnectionFactory adsConnectionFactory;