Skip to content

Commit 6d7610f

Browse files
committed
Include symbols in command pattern
This fixes some math commands which previously could not be invoked
1 parent 983fb34 commit 6d7610f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Sources/D2Handlers/Message/Handler/CommandHandler.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ private struct RunnablePipe: AsyncRunnable {
3838
// The first group matches the command name,
3939
// the second matches the iteration count and
4040
// the third the arguments (the rest of the message content)
41-
nonisolated(unsafe) private let commandPattern = #/(?<name>\w+)(?:\^(?<iterations>\d+))?(?:\s+(?<args>[\s\S]*))?/#
41+
nonisolated(unsafe) private let commandPattern = #/(?<name>[\w+\-*\/%]+)(?:\^(?<iterations>\d+))?(?:\s+(?<args>[\s\S]*))?/#
4242

4343
/// Handles (possibly piped or chained) command invocations.
4444
public class CommandHandler: MessageHandler {

0 commit comments

Comments
 (0)