diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2016-09-19 23:33:42 +1200 |
---|---|---|
committer | Anton Tananaev <anton.tananaev@gmail.com> | 2016-09-19 23:33:42 +1200 |
commit | fd2fd71a522585ade8653618d95eb0f846f4bfbb (patch) | |
tree | 72ac71451fec5ecea2315d2ae44105b40285a7ca /src/org/traccar/helper/PatternUtil.java | |
parent | 56a4fe28c4d72b8ec1f55fce4c8de18c1ef71f73 (diff) | |
download | trackermap-server-fd2fd71a522585ade8653618d95eb0f846f4bfbb.tar.gz trackermap-server-fd2fd71a522585ade8653618d95eb0f846f4bfbb.tar.bz2 trackermap-server-fd2fd71a522585ade8653618d95eb0f846f4bfbb.zip |
Update regex pattern debugger
Diffstat (limited to 'src/org/traccar/helper/PatternUtil.java')
-rw-r--r-- | src/org/traccar/helper/PatternUtil.java | 26 |
1 files changed, 10 insertions, 16 deletions
diff --git a/src/org/traccar/helper/PatternUtil.java b/src/org/traccar/helper/PatternUtil.java index 88c3f053b..f665eb30d 100644 --- a/src/org/traccar/helper/PatternUtil.java +++ b/src/org/traccar/helper/PatternUtil.java @@ -25,20 +25,13 @@ public final class PatternUtil { } public static class MatchResult { - private String pattern; - private String matched; - private String remaining; + private String patternMatch; + private String patternTail; + private String stringMatch; + private String stringTail; - public String getPattern() { - return this.pattern; - } - - public String getMatched() { - return this.matched; - } - - public String getRemaining() { - return this.remaining; + public String getPatternMatch() { + return patternMatch; } } @@ -50,9 +43,10 @@ public final class PatternUtil { try { Matcher matcher = Pattern.compile("(" + pattern.substring(0, i) + ").*").matcher(input); if (matcher.matches()) { - result.pattern = pattern.substring(0, i); - result.matched = matcher.group(1); - result.remaining = input.substring(matcher.group(1).length()); + result.patternMatch = pattern.substring(0, i); + result.patternTail = pattern.substring(i); + result.stringMatch = matcher.group(1); + result.stringTail = input.substring(matcher.group(1).length()); } } catch (PatternSyntaxException error) { Log.warning(error); |