I'm currently learning regular expressions, and one of my tasks is to get all text between <body> and </body> of a html file. When <body> and </body> are on the same line I get a result, but the contents of body is supposed to span across multiple lines which in that instance, doesn't return anything as its only checking the one full line?.
What I don't understand is, where in this regex could I put a new line ?
String regex = "<body>.*?</body>"
also, what new line expression should I use? as I've seen examples such as:
\n \\n '\n' ('\u000A')
Thanks.
Any good tutorials would be appreciated as an alternative