Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Source/componentdefinition.go
Original file line number Diff line number Diff line change
Expand Up @@ -480,7 +480,7 @@ func (component *ComponentDefinition) checkErrors() error {
}

func errorDescriptionIsValid (name string) bool {
var IsValidIdentifier = regexp.MustCompile("^[a-zA-Z][a-zA-Z0-9_+\\-:,.=!/ ]*$").MatchString
var IsValidIdentifier = regexp.MustCompile("^[a-zA-Z][a-zA-Z0-9_+\\-:,.=!/#@%$* ]*$").MatchString

if (name != "") {
return IsValidIdentifier(name);
Expand Down Expand Up @@ -882,7 +882,7 @@ func nameIsValidIdentifier(name string) bool {
}

func descriptionIsValid(description string) bool {
var IsValidMethodDescription = regexp.MustCompile("^[a-zA-Z][a-zA-Z0-9_\\\\/+\\-:,.=!?()'; |]*$").MatchString
var IsValidMethodDescription = regexp.MustCompile("^[a-zA-Z][a-zA-Z0-9_\\\\/+\\-:,.=!?()';&#@%$* |]*$").MatchString
if (description != "") {
return IsValidMethodDescription(description);
Comment on lines +885 to 887

Copilot AI Aug 25, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The regex is compiled every time the function is called. Consider moving the compiled regex to a package-level variable or using regexp.MustCompile once during initialization to improve performance.

Suggested change
var IsValidMethodDescription = regexp.MustCompile("^[a-zA-Z][a-zA-Z0-9_\\\\/+\\-:,.=!?()';&#@%$* |]*$").MatchString
if (description != "") {
return IsValidMethodDescription(description);
if (description != "") {
return IsValidMethodDescription.MatchString(description);

Copilot uses AI. Check for mistakes.
}
Expand Down
Loading