I'm having html page content as a string and trying to check if it matches regexp of ^.+$
. And it returns false. Can't get why it does so.
Code is fairly simple:
content.matches(regexp)
I'm having html page content as a string and trying to check if it matches regexp of ^.+$
. And it returns false. Can't get why it does so.
Code is fairly simple:
content.matches(regexp)
By default, the .
does not match \r
and \n
. To let .
also match them, enable DOT-ALL (the s
flag):
^(?s).+$