I found this question on how to port PHP's preg_match to Java (it recommends using String.matches(). However, I still have trouble with the following situation:
PHP:
preg_match('/<(h1|h2|h3|h4|ul|td|div|table)/i', '<h1>') => returns 1
Java:
"<h1>".matches("/<(h1|h2|h3|h4|ul|td|div|table)/i") => return false
Why would that be?