I have a regex for validating input. I would like to process only the first part (up to \s). Will the second line do the job, or am I missing something?
my research on regex101.com shows it matches the same text.
Original:
input.matches("^NOT\\s+.*"))
and Modified:
input.startsWith("NOT\\s")
this was done to avoid https://www.regular-expressions.info/catastrophic.html according to sonar.
Thanks!