Skip to content

Commit

Permalink
Madhur/improve regex (#192)
Browse files Browse the repository at this point in the history
* add more chars

* add more chars
  • Loading branch information
shrimalmadhur authored Apr 8, 2024
1 parent f565191 commit 33241d3
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion types/operator_metadata_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ func TestOperatorMetadata(t *testing.T) {
name: "Valid metadata with twitter.com url",
metadata: OperatorMetadata{
Name: "Ethereum Utopia",
Description: "Madhur's first operator is best in this world",
Description: "Madhur's first operator is best in this world+&~#",
Logo: "https://goerli-operator-metadata.s3.amazonaws.com/eigenlayer.png",
Twitter: "https://twitter.com/test",
Website: "https://test.com",
Expand Down
2 changes: 1 addition & 1 deletion utils/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ func ValidateText(text string) error {
}

// Regular expression to validate text
textPattern := regexp.MustCompile(`^[a-zA-Z0-9 +.,;:?!'"\-_/()\[\]]+$`)
textPattern := regexp.MustCompile(`^[a-zA-Z0-9 +.,;:?!'"\-_/()\[\]~&#]+$`)

// Check if the URL matches the regular expression
if !textPattern.MatchString(text) {
Expand Down

0 comments on commit 33241d3

Please sign in to comment.