So I have this regex
^<(.*?)>
Which is supposed to match the contents of the first opening tag. However while this works in PHP, in java it matches everything in between the first < and the last >.
For example, when it is run on this:
<tag1 attr1="val1"><tag2></tag2></tag1>
PHP Matches:
tag1 attr1="val1"
while Java matches
tag1 attr1="val1"><tag2></tag2></tag1