I need a regexp to get all string inside a tags like it: <- -> inside this tags include any character, numbers, spaces, carriage return etc. i have this regexp:
Pattern.compile("<-(.+?)->")
but it not detect a special sequence as: \r \n etc.
but it not detect a special sequence as: \r \n etc
It won't match newline unless you use Pattern.DOTALL flag as in:
Pattern p = Pattern.compile("<-(.+?)->", Pattern.DOTALL);
OR else you can use (?s) flag:
Pattern p = Pattern.compile("(?s)<-(.+?)->");
Pattern.DOTALL makes dot match new line character so .+? will also match \r,\n etc.