Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
CreatureChat
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Jobs
Commits
Open sidebar
Public
CreatureChat
Commits
848cc770
Commit
848cc770
authored
Jun 13, 2024
by
Jonathan Thomas
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Allow regex to support optional ":", such as *friendship: 1*
parent
b41a9f30
Pipeline
#12458
passed with stages
in 2 minutes 18 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
1 deletion
+1
-1
MessageParser.java
src/main/java/com/owlmaddie/message/MessageParser.java
+1
-1
No files found.
src/main/java/com/owlmaddie/message/MessageParser.java
View file @
848cc770
...
...
@@ -19,7 +19,7 @@ public class MessageParser {
LOGGER
.
info
(
"Parsing message: {}"
,
input
);
StringBuilder
cleanedMessage
=
new
StringBuilder
();
List
<
Behavior
>
behaviors
=
new
ArrayList
<>();
Pattern
pattern
=
Pattern
.
compile
(
"[<*](FOLLOW|FLEE|ATTACK|FRIENDSHIP|UNFOLLOW)
(?:\\s+([+-]?\\d+)
)?[>*]"
,
Pattern
.
CASE_INSENSITIVE
);
Pattern
pattern
=
Pattern
.
compile
(
"[<*](FOLLOW|FLEE|ATTACK|FRIENDSHIP|UNFOLLOW)
[:\\s]*(\\s*[+-]?\\d+
)?[>*]"
,
Pattern
.
CASE_INSENSITIVE
);
Matcher
matcher
=
pattern
.
matcher
(
input
);
while
(
matcher
.
find
())
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment