If I use a delimiter on a string:
Scanner scanString = new Scanner(line).useDelimiter("<.*>");
I want to know why this won't preserve the text in
<a href="https://post.craigslist.org/c/snj?lang=en">post to classifieds</a>
but it will in a line with only
<option value="ccc">community
While
Scanner scanString = new Scanner(line).useDelimiter("<.*?>");
will work for both.
As I understand it this "<.*>"
should exclude a string starting with "<" followed by any character 0 or more times until it reaches a ">". So shouldn't it not start excluding again until it reaches another "<"?