regex - How to do pattern matching on mulit line string? -
mystring = " <div class="text"> spor </div> "; pattern ="<div class=\"text\">(.*)</div>"; pattern regex = pattern.compile(pattern, pattern.multiline); matcher m = regex.matcher(mystring); if (m.find()) { match = m.group(1); } else { match = "---"; }
not working ?
the 'dot' character doesn't include line break characters default.
have enable pattern.dotall
.
Comments
Post a Comment