-1

I have a regex where I try to find this pattern in a text 15:30:55 (it's time). And the Pattern.compile is giving out an error PatternSyntaxException: U_ILLEGAL_ARGUMENT_ERROR

Here is my code

Pattern.compile("[0-9]{1,2}[:][0-9]{1,2}[:][0-9]{1,2}");
anubhava
  • 761,203
  • 64
  • 569
  • 643
Minasie Shibeshi
  • 390
  • 3
  • 16

1 Answers1

0

Try removing square brackets between colon characters in your regex: [0-9]{1,2}:[0-9]{1,2}:[0-9]{1,2}

Alpay
  • 1,350
  • 2
  • 24
  • 56