-1
Pattern.matches(regex, value);

returns false for the given Parameters:

Regex = [<>:/\\\\|?*] value = This Should /\Match*?

my expectation however is that it should return true, what am I missing here?

0x45
  • 779
  • 3
  • 7
  • 26

1 Answers1

-1

Pattern.matches:

behaves in exactly the same way as the expression

Pattern.compile(regex).matcher(input).matches()

and Matcher.matches:

Attempts to match the entire region against the pattern.

Your regex doesn't match the entire string.

Andy Turner
  • 137,514
  • 11
  • 162
  • 243