(.*?) Match all strings
<p class= "num" >9033</p>
such as using <p class= "(. *?)" >9033</p>
Will get num
However, if a newline character is invalidated, and if a match is required, including a newline character, use the
([\s\s]*)
If you have parentheses or other metacharacters in an expression, you need to use escape. Before the character, add a \
Metacharacters |
Description |
Example |
^ |
Matches the starting position of the entire string, or the starting position of the line, or the excluded type (negative) character group if it is inside a character group |
^start |
$ |
Matches the end position of the entire string, or the end position of the line |
end$ |
() |
grouping, providing reverse reference (GOURP1) \1 or multiple-selection branches |
(AB) + |
* + ? |
quantifiers, limiting the number of times before elements appear |
+ (AB) + |
. |
Matches any character other than a newline character by default, and can match line breaks in multiple-line mode |
|
[ |
Start symbol for character group |
[0-9] |
\ |
A backslash is used to represent an escape sequence, or to remove the escape of a meta character |
\1 |
{ |
Start of the recurrence qualifier |
{2, 6} |
| |
Dividing multiple-selection branches (when parentheses do not appear, you can imagine parentheses appearing at the outermost end of the entire expression) |
Tom| Jerry
|