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

Popular posts from this blog

user interface - Python attempting to create a simple gui, getting "AttributeError: 'MainMenu' object has no attribute 'intro_screen'" -

jquery - Common JavaScript snippet to share files on Google Drive, Dropbox, Box.net or SkyDrive -

Android Gson.fromJson error -