Techie
Techie

Reputation: 83

Sonar scan reports issue in Regex

This line of code in java is reported by sonar scan as a Security hotspot risk under Denial of Service (DoS) category.

name.matches("^.*[^a-zA-Z0-9 \\\\].*$")

How can I fix this? Is there an option to write this regular expression as a Java function?

Upvotes: 0

Views: 33

Answers (0)

Related Questions