Regular Expressions match line breaks, regular expressions match line breaks
At the beginning, we did not find many \ n html documents, and the results were in the format.
<Table [^>]>. * </table>
The data between tables is incorrect. According to Baidu encyclopedia, the solution is as follows:
\ S |
Matches any blank characters, including spaces, tabs, and page breaks. It is equivalent to [\ f \ n \ r \ t \ v]. |
\ S |
Match any non-blank characters. It is equivalent to [^ \ f \ n \ r \ t \ v]. |
Therefore, modify the mode:
<Table [^>] +> [\ s \ S] *? </Table>
? In non-Greedy mode, the system prompts that the regular expression matches to the first </table> and stops.
Regular Expression match line feed
Wo (.*?) \ N (.*?) \{
Wo match
(.*?) Match any non-linefeed character
\ N match the linefeed
(.*?) Match any non-linefeed character
\ {Match {
How can a java regular expression match only line breaks?
In the java regular expression, \ r matches only one carriage return and \ n matches only one line feed.