I need to match a set of strings in Java. This string can contain self ending HTML, one or more white spaces and one or more
s.
For example:
String html = "<p>Stack Overflow is a great site. I really like Stack<br/>Overflow. Stack Overflow has helped me a lot to learn different things. I frequently visit Stack<br></br>Overflow. Stack<div id=\"XX\" />Overflow is really nice.<p><br/><p>Stack and overflow are two different thing.</p>".
Now I need a regular expression which would match the following strings in the above string.
1. Stack Overflow
2. Stack<br/>Overflow
3. Stack Overflow
4. Stack<br></br>Overflow
5. Stack<div id=\"XX\" />Overflow
But it shouldn't match
- Stack and overflow