Skip to content

Commit

Permalink
Fix for agent_name regex (#6108)
Browse files Browse the repository at this point in the history
The improved regex was introduced with
#6096

However, there seems to be an issue with the updated regex;
The uppercase meta-character `\W` only matches non-word characters,
i.e. everything that is NOT [A-Za-z0-9_].
What you actually want is to use the lowercase `\w` character.

Co-authored-by: Simon Rummert <[email protected]>
  • Loading branch information
rummsi1337 and Simon Rummert authored Nov 6, 2023
1 parent 17fa807 commit 25c6d01
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ def create(agent_name):
import re
import shutil

if not re.match("\W*$", agent_name):
if not re.match("\w*$", agent_name):
click.echo(
click.style(
f"😞 Agent name '{agent_name}' is not valid. It should not contain spaces or special characters other than -_",
Expand Down

0 comments on commit 25c6d01

Please sign in to comment.