I am trying to use matcher as an expression to find time stamps in my list of strings. Ex (" [00:00:00.000] ") There are white spaces before and after the time stamp
I checked my regex online and it say it is correct but will not work with my java. It just returns false.
String word = " [00:00:00.000] ";
Pattern pattern = Pattern.compile("^\\s[[0-9:.]*]\\s");
Matcher matcher = pattern.matcher(word);
if(matcher.matches()){
//Do Stuff
else
//Do other Stuff
[like\[and the last]like\]. The reason is that the angle brackets are a special character in regular expressions. So the regex checker is wrong. So, I think this would also have caused issues in other programming languages. (Note, in java you will need to escape twice, (\\[and\\])